Write a java program that will ask the user to enter three


Programming problems

1. Write a Java program that will ask the user to enter three integer numbers and find the greatest or the smallest of these numbers.

The program will then ask the user to enter the choice: 1 (for greatest) and 2 (for smallest). Based on the entered choice, the program displays the greatest or the smallest of the three numbers.

Sample output is as follows:

First number: 24

Second number: 10

Third number: 55

Enter 1 (for greatest) and 2 (for smallest): 1

The greatest of these three numbers is 55

2. Write a Java program that will sort first, middle and last names of the user.

The program will ask user to enter the first, middle and the last names. It will also ask sort order e.g. you will enter ‘1' for ascending alphabetical order and ‘2' for descending alphabetical order.

The program should display the three names arranged in the specified sort order and also print "- OK" (if the total length of the names is less than 20 characters, including the space character) or "- Too long" (otherwise) in front of the name.

For example, if the user enters the names as:

First name: Pradeep

Middle name: Kumar

Last name: Atrey Sort order: 1

The program should display the following:

Atrey Kumar Pradeep - OK

Request for Solution File

Ask an Expert for Answer!!
JAVA Programming: Write a java program that will ask the user to enter three
Reference No:- TGS02902648

Expected delivery within 24 Hours