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:

Please complete the lab in java
 Please complete the lab in java Here is the starting code
Here is the starting code for Numbers.java
/* Programmer:
Date:
Project: Lab 3.1 Numbers
File Name: Numbers.java
Program Description: Performs a series of methods from the Math class.
*/
import java.util.*;
public class Numbers{
public static void main( String[] args ){
Scanner keyboard = new Scanner(System.in);
// enter your code here
}
}

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

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!