Question: Write a Java program that computes the volume of a rectangular object. The volume must be formatted to two decimal places, e.g. 12.48. The formula

Write a Java program that computes the volume of a rectangular object. The volume must be formatted to two decimal places, e.g. 12.48.

The formula is:

Volume= length*width*height

The units for volume is units cubed. For example, if length, width, and height are given in inches, then the units for volume would be inches3, which we call "cubic inches".

Inputs: The program should ask the user to enter the length (L), width (W), and height (H) for the object in inches. So there are three inputs to the program.

Outputs: The program should have this output (below is an example):

The volume for a cube inches long, inches wide, and inches tall is cubic inches.

Where V is the volume your program calculates.

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!