Question: Please help. The program needs to have Java doc comments as well. An oil company would like a program that allows the user to enter

Please help. The program needs to have Java doc comments as well.  Please help. The program needs to have Java doc comments as

An oil company would like a program that allows the user to enter an amount of liquid in ounces, which must not exceed 1 billion. and then displays the number of barrels, gallons, quarts, and ounces. The number of each of these should be maximized from largest to smaller as indicated in Examples 2 and 3 below. Your program should use the following conversion values in the computation: 1 barrel 42 gallons, 1 gallon 128 ounces: 1 quart = 32 ounces. The oil company would like for the program's I/O to be as shown in the three example runs below where (1) 123456790 entered, (2) 12345 it entered, and (3) 12345678 is entered. Your program must follow the above formal with respect to the output. Note that lines 3 through 6 for examples 2 and 3 begin with tab (i.e., output should use the escape sequence for a lab). The input and output variables should be declared as type int. A simple if-else statement can be used to check that the amount does not exceed one billion, where the true block prints the error message and the false block prints the normal output (or vice-versa). Also, the return statement (return;) can be used in an if statement to return from main to immediately end the program after the error message. In order to recede full credit for this assignment, you must calculate the number of barrels, gallons, quarts, and ounces and store them in separate variables. It is recommended as a practice that you do not modify input values once they are stored. You will be responsible for testing your program, and it is important to not rely only on the example above. For example, test with the following amounts: 16, 32, 128, and 5376. The last amount is the number ounces in a barrel (42 * 128)

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!