Question: Write a program that prompts the user to enter a number of student marks and credits, the program uses nested if-else to calculate and
Write a program that prompts the user to enter a number of student marks and credits, the program uses nested if-else to calculate and prints the student GPA. The program stops reading when the mark -1 is entered. The GPA is calculated using the following formula: CW, and C, are the course weight and the credit of the first course, respectively. You will need to determine the course weight for each course. The course weight for a course is: 0 if mark < 60 1 if 60 mark < 70 2 if 70 mark < 80 3 if 80 mark < 90 4 if 90 mark 100 Sample input/output: Enter a mark and a credit, -1 for the mark to stop: 73 3 Enter a mark and a credit, -1 for the mark to stop: 81 2 Enter a mark and a credit, -1 for the mark to stop: 68 4 Enter a mark and a credit, -1 for the mark to stop: -1 3 The GPA of the 3 courses is 1.77778 Enter a mark and a credit, -1 for the mark to stop: -1 3 You did not enter any mark!
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
