Question: Write a program called UseMath. It should contain a class called UseMath that contains the method main. The program should ask for two double numbers
Write a program called UseMath. It should contain a class called UseMath that contains the method main. The program should ask for two double numbers from the user and then print the information shown in the examples below. Use printf to display only 2 digits to the right of the decimal point. Look at the examples below and write your program so it produces the same input/output.
(the input from the user is in bold face) % java UseMath enter a double number: 1 enter another double number: 2 the absolute value of your first number is: 1.00 the cube root of your second number is: 1.26 the square root of your first number is: 1.00 the log base 10 of your second number is: 0.00 the greater of your two numbers is: 2.00 the smallest of your two numbers is: 1.00 1.00 to the power of 2.00 is 1.00 % java UseMath enter a double number: 2.0 enter another double number: 3.0 the absolute value of your first number is: 2.00 the cube root of your second number is: 1.44 the square root of your first number is: 1.41 the log base 10 of your second number is: 0.30 the greater of your two numbers is: 3.00 the smallest of your two numbers is: 2.00 2.00 to the power of 3.00 is 8.00 % java UseMath
Step by Step Solution
There are 3 Steps involved in it
1 Expert Approved Answer
Step: 1 Unlock
Question Has Been Solved by an Expert!
Get step-by-step solutions from verified subject matter experts
Step: 2 Unlock
Step: 3 Unlock
