Question: your project 5 does not make use of methods at all, which is the primary purpose of the project. Would you like to re-submit with

your project 5 does not make use of methods at all, which is the primary purpose of the project. Would you like to re-submit with methods in place of your switch statement? (Or rather, you can keep the switch statement, but use it to call methods.)

My project below was answered here in chegg and need help with this question above from the professor on fixing the issues that were presented. Below provided is the following code and the assignemnt that was provided thank you.

* This program is to create a code in java that the user ask until user * exit using while loop, under while loop user input choice switch case * to menu base code that user asked choice to convert. */ import java.util.Scanner;

public class ConvertChoiceSwitchWhile {

public static void main(String[] Theargs) { //declare the variable final double US_BUSHELS = 0.803564; final double KILOMETER = 1.609344; //scanner class Scanner scanner = new Scanner(System.in); int choice = 0; double input;

while (choice != 9) { //loop until user input 9 //menu System.out.println("MENU"); System.out.println("Please choose an option:"); System.out.println("1. Convert cubic feet to U.S. bushels"); System.out.println("2. Convert miles to kilometers"); System.out.println("3. Determine graduation title with honors"); System.out.println("9. Exit program"); System.out.print(" Enter your selection: "); choice = scanner.nextInt();

switch (choice) { case 1: //for convert cubic to US bushels System.out.print(" \tEnter cubic feet: "); input = scanner.nextDouble(); //input double bushels = input * US_BUSHELS; //convert System.out.printf("\t%d cubic ft. = %.4f U.S. bushels ", (int)input, bushels); //display System.out.print(' '); break; case 2: //for convert miles to kilometers System.out.print(" \tEnter miles: "); input = scanner.nextDouble(); //input double kilometers = input * KILOMETER; //convert System.out.printf("\t%d miles = %.4f kilometers ",(int)input, kilometers); //display System.out.print(' '); break; case 3: System.out.print(" \tEnter GPA: "); //ask to enter GPA input = scanner.nextDouble(); //input gpa //check for the range in gpa and print message if (input >= 3.9) { System.out.println("\tCongratulations, You have graduated Summa Cumm Laude!"); } else if (input >= 3.7) { System.out.println("\tCongratulations, You have graduated Magna Cumm Laude!"); } else if (input >= 3.5) { System.out.println("\tCongratulations, You have graduated Cumm Laude!"); } else { System.out.println("No honor"); } System.out.print(' '); break; case 9: System.out.println("Thank you for using the program. Goodbye!"); System.exit(0); //exit the program default: System.out.println("Invalid choice, please try again."); // System.out.print(' '); break; } } scanner.close(); } }

your project 5 does not make use of methods at all, whichis the primary purpose of the project. Would you like to re-submitwith methods in place of your switch statement? (Or rather, you can

a. Convert cubic feet to U.S. bushels b. Convert miles to kilometers c. Determine graduation with honors title d. Exit program 2. Programs at a minimum must have the following methods: a. Convert cubic feet method that gets cubic feet and returns U.S. bushels. b. Convert to kilometers method that gets miles and returns kilometers c. Determine graduation with honors title method that gets GPA and returns honors title value (category) 3. For each action, the user should be prompted for corresponding data and provided the appropriate result as output. 4. Users should be able to select one action via the menu and then get prompted again for another menu selection until they select the exit choice Use the following for calculations or category determination - To convert from cubic feet to U.S. bushels use the formula: 1 cubic foot =0.803564 U.S. bushel - To convert from miles to kilometers use the following formula: 1 mile =1.60934km - To determine graduation with categories of Honors title, create a method that uses a switch statement and the following ranges - For c1 Test program: A minimum of 4 test cases should be supplied in the form of a table with columns indicating the input values, expected output, actual output, and if the test case passed or failed. This table shouldcontain 4 columns with appropriate labels and a row for each test case. An example template is shown below. Note that the actual output should be the actual results you receive when running your program and applying the input for the test record. Make sure your Java program is using the recommended style such as: - Javadoc comment upfront with your name as author, date, and brief purpose of theprogram - Comments for variables and blocks of code to describe major functionality - Meaningful variable names and prompts - Identifiers are written in upper CamelCase - Class name starts with upper case letter and variables in lower case letter - Constants are written in All Capitals - Use proper spacing and empty lines to make code human-readable Capture execution: You should capture and label screen captures associated with compiling your code and runningeach of your test cases. Here is a sample run: RUN: MENU 1: Convert cubic feet to U.S. bushels 2: Convert miles to kilometers 3: Determine graduation title with honors 9: Exit program Enter your selection: 1 Enter cubic feet: 5 5 cubic ft. =4.01782 U.S. bushels MENU 1: Convert cubic feet to U.S. bushels 2: Convert miles to kilometers 3: Determine graduation title with honors 9: Exit program Enter your selection: 2 Enter miles: 12 12 miles =19.3121km MENU 1: Convert cubic feet to U.S. bushels 2: Convert miles to kilometers 3: Determine graduation title with honors 9: Exit program Enter your selection : 3 Enter GPA: 3.8 Congratulations, you have graduated Magna Cum Laude! MENU 1: Convert cubic feet to U.S. bushels 2: Convert miles to kilometers 3: Determine graduation title with honors 9: Exit program Enter your selection: 9 Thank you for using the program. Goodbye! Example test cases: Submission requirements Deliverables include a Java program (.java) and a single Word (or PDF) document. The Java andWord/PDF files should be named appropriately for the assignment (as indicated in the SubmissionRequirements document. The word (or PDF) document should include screen captures showing the successful compilingand running of each of the test cases. Each screen capture should be properly labeled to indicate what the screen capture represents. The test cases table should be included in your Word or PDF document and properly labeled as well. Submit your files to the Assignment 5 submission area no later than the due date listed in the online classroom calendar. a. Convert cubic feet to U.S. bushels b. Convert miles to kilometers c. Determine graduation with honors title d. Exit program 2. Programs at a minimum must have the following methods: a. Convert cubic feet method that gets cubic feet and returns U.S. bushels. b. Convert to kilometers method that gets miles and returns kilometers c. Determine graduation with honors title method that gets GPA and returns honors title value (category) 3. For each action, the user should be prompted for corresponding data and provided the appropriate result as output. 4. Users should be able to select one action via the menu and then get prompted again for another menu selection until they select the exit choice Use the following for calculations or category determination - To convert from cubic feet to U.S. bushels use the formula: 1 cubic foot =0.803564 U.S. bushel - To convert from miles to kilometers use the following formula: 1 mile =1.60934km - To determine graduation with categories of Honors title, create a method that uses a switch statement and the following ranges - For c1 Test program: A minimum of 4 test cases should be supplied in the form of a table with columns indicating the input values, expected output, actual output, and if the test case passed or failed. This table shouldcontain 4 columns with appropriate labels and a row for each test case. An example template is shown below. Note that the actual output should be the actual results you receive when running your program and applying the input for the test record. Make sure your Java program is using the recommended style such as: - Javadoc comment upfront with your name as author, date, and brief purpose of theprogram - Comments for variables and blocks of code to describe major functionality - Meaningful variable names and prompts - Identifiers are written in upper CamelCase - Class name starts with upper case letter and variables in lower case letter - Constants are written in All Capitals - Use proper spacing and empty lines to make code human-readable Capture execution: You should capture and label screen captures associated with compiling your code and runningeach of your test cases. Here is a sample run: RUN: MENU 1: Convert cubic feet to U.S. bushels 2: Convert miles to kilometers 3: Determine graduation title with honors 9: Exit program Enter your selection: 1 Enter cubic feet: 5 5 cubic ft. =4.01782 U.S. bushels MENU 1: Convert cubic feet to U.S. bushels 2: Convert miles to kilometers 3: Determine graduation title with honors 9: Exit program Enter your selection: 2 Enter miles: 12 12 miles =19.3121km MENU 1: Convert cubic feet to U.S. bushels 2: Convert miles to kilometers 3: Determine graduation title with honors 9: Exit program Enter your selection : 3 Enter GPA: 3.8 Congratulations, you have graduated Magna Cum Laude! MENU 1: Convert cubic feet to U.S. bushels 2: Convert miles to kilometers 3: Determine graduation title with honors 9: Exit program Enter your selection: 9 Thank you for using the program. Goodbye! Example test cases: Submission requirements Deliverables include a Java program (.java) and a single Word (or PDF) document. The Java andWord/PDF files should be named appropriately for the assignment (as indicated in the SubmissionRequirements document. The word (or PDF) document should include screen captures showing the successful compilingand running of each of the test cases. Each screen capture should be properly labeled to indicate what the screen capture represents. The test cases table should be included in your Word or PDF document and properly labeled as well. Submit your files to the Assignment 5 submission area no later than the due date listed in the online classroom calendar

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!