Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Question 1.A. Write a Java program that uses a Scanner object to read in three numbers. Multiply the first number by the second number. Square

Question 1.A. Write a Java program that uses a Scanner object to read in three numbers. Multiply the first number by the second number. Square the second number. Take the square root of the third number. Then print the calculated values, the sum of the three numbers, the largest of the three numbers and the smallest of the three numbers. See the sample below for proper formatting of the output. You should control for the decimal point to two decimal places by using the printf statement (see the end of this assignment for a description). You can assume all three numbers are different and you can use the Math Class.

Sample output:

image text in transcribed

Provide:

Printout of Properly Formatted Source Code

Example output/test cases (2 test cases different than above that show both cases).

Question 1.B. Write a Java program that uses a Scanner object to read in two numbers and determines the smaller and larger number without using Java's Math Class. The program will print the smaller of the two numbers, the larger of the two numbers OR indicate that the numbers are the same.

Sample output:

//Prints the larger and smaller numbers

Enter two numbers: 22 10

The largest number is 22

The smallest number is 10

//Prints that both numbers are the same

Enter two numbers: 10 10

Both numbers are the same

Provide:

Printout of Properly Formatted Source Code

Example output/test cases (2 test cases different than above that show both cases).

Make sure it is done in Java format.

Please answer all parts of the question.

Or else it will be sent in fo reviews.

jGRASP exec: java A1_MathClass Enter 3 numbers and then hit enter 6 11 40 The new numbers are 66.00, 121.00, 6.32 The sum of all three numbers is 193.32 The smallest number is 6.32 The largest number is 121.00 ----iGRASP: operation complete

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image_2

Step: 3

blur-text-image_3

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Databases Illuminated

Authors: Catherine Ricardo

2nd Edition

1449606008, 978-1449606008

More Books

Students also viewed these Databases questions

Question

What is the purpose of the Salary Structure Table?

Answered: 1 week ago

Question

What is the scope and use of a Job Family Table?

Answered: 1 week ago