Question: Please complete the lab in java Here is the starting code for Numbers.java /* Programmer: Date: Project: Lab 3.1 Numbers File Name: Numbers.java Program Description:
Write a program that meets the following requirements Force the user to input a negative integer. It must be trapped so that the user cannot enter a non-negative number 1. 2. Cube the input number, using the pow) method of the Math class 3. Take the absolute value of the result from Step 2 4. Compute the square root of the number from Step 3 5. Round the number from Step 4 to 3 decimal places using the round) method of the Math class Let the user know what mathematical operations are being calculated during Steps 2-5. Save the program as Numbers.java Sample Output: Input a negative integer:-4 -4) 3- 64.0 The absolute value of 64 is: 64 The square root of 64 is: 8.0, which rounds to 8.0 Input a negative integer: 5 Input a negative integer:-5 (-5) A 3- 125.0 The absolute value of-125 is: 125 The square root of 125 is: .18033988749895, which rounds to 11.180
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
