Question: For credit, the program MUST include a sample run in a block comment below the last curly brace (below the program code). If this is

 For credit, the program MUST include a sample run in a
block comment below the last curly brace (below the program code). If
this is not included, then the program is not complete. The program
could be resubmitted for late credit if turned in with the sample
run. Up to: 3 A. Write the Java program to implement a

For credit, the program MUST include a sample run in a block comment below the last curly brace (below the program code). If this is not included, then the program is not complete. The program could be resubmitted for late credit if turned in with the sample run. Up to: 3 A. Write the Java program to implement a menu: Included introductory Standard (**) block comment that includes: Name of project, description, Input, Computation, Output, And, name, and date in standard format Successfully includes appropriate comments for each section of code 2 2 4 Indentation is standard Program uses a while or do loop to loop until the exit choice is selected Program displays the menu and based on the selection made, performs that part of the switch statement (2 points for each programmed choice) 3 Program computes results and calculates correctly. Includes blank lines in both the program and output for readability 2 IN Total points possible 20 Option B: /** Cost PerLiter. Cost PerGallon * This program converts liters to gallons and gallons to liters * * Declare variables (at the top of your program) * Include the name of the program and your name as author * Describe the program to the user * Top of loop: (repeat until a 3 is entered by the user) Display the menu 1) 7/converts cost of gas purchased in liters to cost per gallon Acknowledge that a 1 has been entered Ask user for number of Liters purchased Ask user for cost of gas Convert Liters to Gallons Compute cost per gallon Print out the results 2) //Converts cost of gas purchased in gallons to cost per liter) Acknowledge that a 2 has been entered Ask user for number of gallons purchased Ask user for cost of gas Convert from Gallons to Liters Compute cost per liter Print the results 3) Acknowledge that a 3 has been entered. State that the program will end * After the loop ends, thank the user for using your program (include your name here) * Formulas that you might need to use: * One gallon 3.785411784 liters * One liter = 0.26417205235815 gallons * How many gallons is: 20 liters? gallons = 200.26417205235814843 * How many liters is 20 gallons? * liters 20 * 3.785411784 * @author (Your name and Zenia Bahorski) * @version (15 February 2021) This program will determine Cost per Liter and Cost Per Gallons Choose the conversion from the menu. Choose from the menu: 1: Cost per Gallon, based on number of Liters purchased 2: Cost per Liter, based on number of Gallons purchased 3: Quit the program Enter your choice: 1 1 has been entered Determining cost per Gallon... Enter number of Liters purchased: 10 Enter total cost of gas: 10 10.0 liters at $10.0 costs 3.785411784 per gallon 10.00 liters at $ 10.00, costs $ 3.785 per gallon Choose from the menu: 1: Cost per Gallon, based on number of Liters purchased 2: Cost per Liter, based on number of Gallons purchased 3: Quit the program Enter your choice: 2 2 has been entered Determine cost per Liter... Enter number of Gallons purchased: 10 Enter total cost of gas: 25.70 10.0 gallons at $25.7 costs 0.6789221745604413 per liter 10.00 gallons at $ 25.70, costs $ 0.679 per liter

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!