Java | JSP | JSF Answers

Questions: 4 418

Answers by our Experts: 3 943

Need a fast expert's response?

Submit order

and get a quick answer at the best price

for any assignment or question with DETAILED EXPLANATIONS!

Search & Filtering

Write a score board program that can store the runs of the individual players in singly linked. User can save the run on specific location as per batting order in the list. If the requested location doesn't exist in the list or already filled by some other player, Show the error message and request user to re-enter correct batting order.

 Once you done insertion operation for all eleven players, a method named “generateBBst” create a balanced binary search tree and take the score of first player as a root node and add rest of the score accordingly as per BST rules. Following mandatory methods must have in your program along with supporting methods.

·       treeHeight() : Return the height of the tree.

·       mergeSort() : Display the BST by using merge sort approach .

·       searchTime: Calculate the number of comparison to find the specific node value.


implement a Java program to make a chat platform using synchronization between 3 threads.

similar code like below:

class Chat {
   boolean fl = false;
   public synchronized void Ques(String g) {
      if (fl) {
         try {
            wait();
         }catch (InterruptedException e) {
            e.printStackTrace();
         }
      }
      System.out.println(g);
      fl=true;
      notify();
   }
   public synchronized void Ans(String g) {
      if (!fl) {
         try {
            wait();
         }catch (InterruptedException e) {
            e.printStackTrace();
         }
      }
      System.out.println(g);
      fl=false;
      notify();
   }}
class T1 implements Runnable{
   Chat m;
   String[] s1={"Hi","How r u ?"};

   public T1(Chat m1) {
      this.m=m1;
      new Thread(this,"Ques").start();
   }
   public void run() {
      for (int i=0;i<s1.length;i++) {
         m.Ques(s1[i]);
      }}}
class T2 implements Runnable {
   Chat m;
   String[] s2={ "Hi","Great" };
   public T2(Chat m2) {
      this.m=m2;
      new Thread(this,"Ans").start();
   }
   public void run() {
      for (int i=0;i<s2.length;i++) {
         m.Ans(s2[i]);
      }}}
public class TestThread {
   public static void main(String[] args) {
      Chat m=new Chat();
      new T1(m);
      new T2(m);
   }}










Create a program where you have to design your own Java console application about any valid problem that your application must solve. Your solution can include solving a business problem, a new idea or even a game. Your application must make use of concepts such as arrays, loops, inheritance, constructors and information hiding. Output must be shown in the form of a report using the console. Use Advanced arrays & Introduction to inheritance



Create a GUI interface


1. When the program starts the user needs to be asked if they want to make a new entry or to

view a previous entry

2. If the user wants to make a new entry, the first question will be how many meters they

travelled (this will then need to be converted into kilometers)

3. The second question will give the user 3 options to choose from, and each option will have a

value. The options are as follows:

a. Hatchback = 3

b. SUV = 3.5

c. Sports car = 4.

When the user has selected an option that options value needs to be multiplied by the

distance they travelled in kilometers

4. The third question will allow the user to enter a description, of where they travel to and why

did they travel there.

5. All the information above needs to then be saved into a JSON file

6. If the user says he want to view a previous entry the JSON file needs to be loaded and

displayed.

7. You need to make use of error handling to ensure that the user only types in items that are

asked and not anything else


Write a program that reads a person's first and last names separated by a space, assuming the first and last names are both single words. Then the program outputs last name, first name. End with newline.


Instructions

You will need to complete the following objectives as a Java Application: create a GUI interface

1. When the program starts the user needs to be asked if they want to make a new entry or to

view a previous entry

2. If the user wants to make a new entry, the first question will be how many meters they

travelled (this will then need to be converted into kilometers)

3. The second question will give the user 3 options to choose from, and each option will have a

value. The options are as follows:

a. Hatchback = 3

b. SUV = 3.5

c. Sports car = 4.

When the user has selected an option that options value needs to be multiplied by the

distance they travelled in kilometers

4. The third question will allow the user to enter a description, of where they travel to and why

did they travel there.


5. You need to make use of error handling to ensure that the user only types in items that are

asked and not anything else



Write a program that prompts the user for an integer and then prints out all coward numbers up to

that integer. For example, when the user enters 20, the program should print: 3 4 6 8 12 14 18 20.

Recall that a number is a prime number if it is not divisible by any number except 1 and itself.

Hint: Use Nested Loop to solve this problem. Outer Loop iterations must start from 3 and ideally inner

loop iterations must start from 2.

Coward Number: Number whose previous number is not divisible by any number other than 1

and number itself.

Instructions:

1. Create a program called CowardNumbers.java.

2. Create appropriate variables and assign values using a Scanner object.


Write a program that asks the user to enter three positive integer value; number, start, end and

Silicon Value, and then prints the Silicon table of the number from the starting number to the ending

number. After printing the table, our program should ask the user whether he or she wishes to perform

the operation again. If so, the loop should repeat; otherwise it should terminate.

Use a character input of y or Y to repeat, and n and N to terminate the loop. No break statement is

allowed.


NOTE: Perform input validation so that all numbers must be greater than 0 and the “start” number

should be less than “end” number.

NOTE: Silicon Number is multiplied with iteration counter as shown in the table below


:


Enter a number: 5

Enter starting value: 3

Enter ending value: 7

Enter silicon value: 9


Silicon Table:

5 * 3 * 9 = 135

5 * 4 * 18 = 360

5 * 5 * 27 = 675

5 * 6 * 36 = 1080

5 * 7 * 45 = 157

Enter a number: 6

Enter starting value: 5

Enter ending value: 6

Enter silicon value: 8




Write a program that asks the user to enter three positive integer value; number, start, end and

Silicon Value, and then prints the Silicon table of the number from the starting number to the ending

number. After printing the table, our program should ask the user whether he or she wishes to perform

the operation again. If so, the loop should repeat; otherwise it should terminate.

Use a character input of y or Y to repeat, and n and N to terminate the loop. No break statement is

allowed.


NOTE: Perform input validation so that all numbers must be greater than 0 and the “start” number

should be less than “end” number.

NOTE: Silicon Number is multiplied with iteration counter as shown in the table below.


Question-1 [10 Points]

Write a program that prompts the user for an integer and then prints out all coward numbers up to

that integer. For example, when the user enters 20, the program should print: 3 4 6 8 12 14 18 20.

Recall that a number is a prime number if it is not divisible by any number except 1 and itself.

Hint: Use Nested Loop to solve this problem. Outer Loop iterations must start from 3 and ideally inner

loop iterations must start from 2.

Coward Number: Number whose previous number is not divisible by any number other than 1

and number itself.

Instructions:

1. Create a program called CowardNumbers.java.

2. Create appropriate variables and assign values using a Scanner object.


LATEST TUTORIALS
APPROVED BY CLIENTS