Question: They liked our program so much that they determined that they wanted it expanded so they could see what they needed for all their classes.
They liked our program so much that they determined that they wanted it expanded so they could see what they needed for all their classes.
Our mission now is to make it so that the user can enter data for all classes and see what they might need for a score on the Last Test to get a particular letter grade in each course they are taking.
What this means is that we need to make a copy of Assignment 2 and modify it to meet some additional requirements which some of them are as follows:
- They must be able to have a way to let the program know that they don't have another class to record
- They must give the name of the class i.e. CS II
- They must give all information for each class before moving on.
- They must give the output after all information is received and all calculations are done.
- You must use a 2-dimensional array to store all the scores
- The menu must be a separate method
- Calculating what the Last Test needs to be must be a separate method that receives access to a 1-dimensional array and returns the score.
- All classes' scores are the same and calculated the same.
- The order that data is entered matters
- menu choice
- class name
- 3 scores
- ask if they have another class (enter 1 for yes and 0 for no)
- cannot use a global variable
- the switch menu statement must be in a different method
- have a separate menu that receives access to the 1-D array and returns the score (can override for each row)
here is the program that I need to change to the correct format... if you could help me I would really appreciate it!
import java.util.Scanner;
public class FinalExam { public static void main(String[] args){ // declaring all variables Scanner in = new Scanner (System.in); int choice; double quiz; double asign; double project; double Final = 0; double current; double grade; char letterGrade = 'A'; // displaying the menu System.out.println("Please enter your choice of grade"); System.out.println(); System.out.println("1.\t A: 90-100"); System.out.println("2.\t B: 80-89.9"); System.out.println("3.\t C: 70-79.9"); System.out.println("4.\t D: 60-69.9"); System.out.println("5.\t F: 0-59.9"); System.out.println("6.\t You would like to exit the program"); //getting users choice choice = in.nextInt(); // Displaying choice switch (choice) { case 1: System.out.println("You selected, A"); Final = 90; letterGrade = 'A'; break; case 2: System.out.println("You selected, B"); Final = 89.9; letterGrade = 'B'; break; case 3: System.out.println("You selected, C"); Final = 79.9; letterGrade ='C'; break; case 4: System.out.println("You selected, D"); Final = 69.9; letterGrade = 'D'; break; case 5: System.out.println("You selected, F"); Final = 59.9; letterGrade = 'F'; break; case 6: System.out.println("Exiting the program"); System.exit(0); System.out.println("Ending the program"); break; default: System.out.println("invaild choice"); } //getting grades from student to claculate the final grade System.out.println("Please enter your Quiz average"); quiz = in.nextDouble(); System.out.println("Please enter your Assignment average"); asign = in.nextDouble(); System.out.println("Please enter your Project average"); project = in.nextDouble(); //doing the math for the final grade current = (.20 * asign + .20 * quiz + .20 * project); grade = (Final - current) / .40;
// output if (grade > 100){ System.out.println("You would need to make over 100 to pass the class for an " + letterGrade); }else if (grade <= 0){ System.out.println("You do not have to take the final to get that grade to get a " + letterGrade); }else { System.out.printf("To make a " + letterGrade + " in the class, you at least need to make a: %.3f ", grade); } } }
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
