Answered step by step
Verified Expert Solution
Question
1 Approved Answer
With your current Java knowledge, you have decided to write a program that will calculate a student's GPA for the current semester. The program
With your current Java knowledge, you have decided to write a program that will calculate a student's GPA for the current semester. The program should prompt the user to enter four values representing the number of A, B, C and Ds earned for the semester then calculate and display the GPA. When writing the program, consider the following: The program should prompt the user to enter four INTEGER values representing the number of grades earned for each letter grade. GPA is calculated by dividing the total points earned by the total number of credits attempted. All of the courses taken for the semester are 4 credits. To determine the calculations, A grades have a point value of 4, B grades a point value of 3, C grades a point value of 2 and D grades a point value of 1. Total Number of Credits Attempted = Sum of Number of Courses multiplied by the number of credits for each course. The total points earned is the sum of the credit hours multiplied by the point value for each letter grade. Use the Scanner class to accept the user input. The output should be displayed with 3 significant decimal places. Explicit casting and constant representation should be used where applicable. . Output should be displayed in full sentence. Save the code as GPAScanner.java Sample Program Execution: GPA Calculator Enter the number of A grades earned: 3 Enter the number of B grades earned: : 1 Enter the number of C grades earned: 0 Enter the number of D grades earned: : 2 Grade A Credit Hours Grade Points 12 48 B 4 12 C 0 0 D 8 8 Total 24 68 The GPA for attempting 24 credit hours and earned grades is 68/24 = 2.833 Part II. Modify the program above to accept the input using GUI window dialog boxes. Test your program with different input values. Save the program as GPAGUI.java Be sure to include the following in both files o Headers containing appropriate information Informative comments o Whitespace and indentation User prompts for entered data Aligned and labeled output
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started