Question: For this exercise, you will use the Scanner Class and the Math Class. Write a program that uses a Scanner object to read in two

For this exercise, you will use the Scanner Class and the Math Class. Write a program that uses a Scanner object to read in two different numbers. Determine which is the largest and smallest of the two numbers. Print the number that is the largest of the two. Then subtract the smallest number from the largest of the two numbers and print this result. Calculate and print the square this result. Calculate and print the square of the small number. Then print out the largest of the two numbers. See below for sample output.

Type the first number: 10 Type the second number: 60

The largest number is 60.0 60.0 minus 10.0 is 50.0 The square of 50.0 is 2500.0 The square of 10.0 is 100.0 2500.0 is larger than 100.0

Test the program with three sets of data and include the results in this report. Do not concern yourself with controlling the display of the decimal point.

Program:

Output (3 different outputs):

SOLUTIONS AND OUTPUTS NEED TO BE IN JAVA FORMAT. (PLEASE SHARE YOUR SCREENSHOTS AS WELL).

NOTE: 3 OUTPUTS

Needs to be done step by step in simple manner.

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!