Academic Integrity: tutoring, explanations, and feedback — we don’t complete graded work or submit on a student’s behalf.

JAVA Help with JOptionPane, loops, and switch statements: Your mission is to imp

ID: 3678123 • Letter: J

Question

JAVA Help with JOptionPane, loops, and switch statements:

Your mission is to implement the class GpaCalculator. This class should calculate the GPA for a student based on the letter grades of they enter along with the number of credit hours each class is worth. The student will enter only the number of credit hours and the letter grade for each class. The GPA is calculated as follows: IF a student has 1 class with 4 credit hours and gets a B, a second class with 3 credits hours and gets a A, and a thrid class with 2 credit hours gets a C

GPA = creditsEarned / creditHours = 38/11 = 3.4545

The user (student) should be able to enter as many grades and credit hour pairs as they want. To end data entry, have the user enter a ‘Q’ to quit instead of a grade, indicating that there are not more course grades to enter. A separate popup window, asking the user if they want to continue should not be used.

A standard for the value of credit earned per grade is: Letter Grade Credits A 4, B 3, C 2, D 1, F 0

• You should use a loop (either a do while loop or a while) to loop though the data entry. • You must use the switch statement to determine the credits based on grade • Final display should include the grade and credit hours for each course entered as well as an explanation of what they are (column labels Grade & hours). Grade and hours must be displayed side by side. • This program should loop until the user enters a “Q”. There should not be a separate JPanel to ask if you want to quit • Only 1 decimal point in final GPA

Explanation / Answer

GPA calculator programs in JAVA:

Program 2: