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

Command line argument in java programming

Command line argument count program in java

Write Java program that randomly generate two Integers between 1 and 10 as input and perform an operation (+,-,*,x,/) on them and displays the result of that operation. The program should tell the user whether the result is an even number or odd number. If the result is an even number the program should generate again two integers and repeat the process again. The program will only stop when the result of the operation is an odd number.

Hint: (An even number is a number that can be divided into two equal groups. An odd number is a number that cannot be divided into two equal groups)

Expected output of the program

The number of time the program generated the random number.

The value of the odd that stops the program.

Marks allocation

1. Use of a random function - 10 Marks

2. Use of a loop - 10 Marks

3. Use of a switch case 10 Marks

4. The use of a sentinel value - Odd number to stop the program - 10

4. correct output- 10


Ms. Blanchett owns 5 apartment buildings. Each building contains 10 apartments that she rent out for RM 500 per month each. The program should output 12 payment coupons for each of the 10 apartments in each of the 5 buildings. Each coupon should contain the building number (1 through 5), the apartment number (1 through 10), the month (1 through 12), and the amount of rent due.


Having one number as parameter - both length and breadth are assigned that number

A method called absoluteValue, which takes as its only parameter a value of type double, and

returns a value of type double. The parameter represents an arbitrary number, and the value returned

by the method represents the absolute value of this arbitrary number. The absolute value of a number

x, denoted |x|, is x if x is greater than or equal to 0, and -x if x is less than 0. For example, suppose the

following method call is executed:

double value = MathAssignment.absoluteValue(-42.0);

After the execution of the above method call, the value stored in variable value will be 42.0, as the

absolute value of -42 is 42.

3. Now write the main method and call both methods with appropriate arguments. Make sure that you

call both methods with enough valid values to show their


Control Structures: As a build-up from the previous question, consider 3 possible scenarios of input: A character, number, or word. Your program should then do the following:

  • In case the input is a character it should indicate if it’s a vowel or not
  • when a number is entered then it’s should check if it’s a prime
  • Finally, if a word is entered the system should check if it’s a palindrome or not.

Use netbeans. •

Once you are done with your programming exercise, always screenshot your work CLEARLY. • All screenshots should be placed in a document then convert it into PDF file format. Procedure:

1. Create a project named PE3Lastname. (ex. PE3DelaCruz)

2. Set the JFrame’s final width and height 350 and 200 respectively.

3. You should enter your complete name in the JTextfield. Then click the submit button to display the text “Hello” concatenated with your complete name.

4. Observe the given output for your refence.


As a build up from the previous question, consider 3 possible scenario

of input : A character, number or word. You program should the do the following: In case

the input is a character it should indicate if it’s a vowel or not, when a number is entered

then it’s should check if it’s a prime and finally if a word is entered the system should check

if it’s a palindrome or not


Write a program in Java that connects to a database and generates a report that consists of the list of Vaccination Centers which are offering a specific Vaccine (Covishield or Covaxin). Some centers may offer both the vaccines. Input to the Java program will be name of Vaccine. Make assumptions wherever necessary. 


LATEST TUTORIALS
New on Blog
APPROVED BY CLIENTS