70.2k views
4 votes
Program 11

Calculating Grades
For this assignment you will create a program for Python3 that will prompt the user for the grading criteria for a class, then it will ask the user for grades/averages for the different types of assignments in the class, tell the student what their current grade is if they do not take the final and then tell them what score they need on the final for various letter grades.
A couple of test case executions I used for testing my solution were:
Test Case 1
How many tests were given? 2
Percentage weight of Test 1: 5
Percentage weight of Test 2: 15
Percentage weight of Final: 20
Percentage weight of Homework (0 for no hw): 20
Percentage weight of Programs (0 for no pgms): 40
Test 1 score: 80
Test 2 score: 90
Homework Average: 99
Program Average: 88
Your current numeric score in the class(without the final) is 72.5
If you did not take the final you would get a "C" in the class
To get a "B" in the class you would need to score a 37 on the final
To get an "A" in the class you would need to score a 87 on the final

Test Case 2
How many tests were given? 2
Percentage weight of Test 1: 10
Percentage weight of Test 2: 10
Percentage weight of Final: 20
Percentage weight of Homework (0 for no hw): 20
Percentage weight of Programs (0 for no pgms): 40
Test 1 score: 60
Test 2 score: 62
Homework Average: 64
Program Average: 66
Your current numeric score in the class(without the final) is 51.4
If you did not take the final you would get an "E" in the class
To get a "D" in the class you would need to score a 43 on the final
To get a "C" in the class you would need to score a 93 on the final
It is not possible for you to get an "A" or "B" in the course

Misc. Information:
• The program needs to work for other test cases or real life possibilities
• You should check that the percentages the user inputs adds up to 100. If they do not, you should notify the user and ask whether, or not, they want to continue.
• If the user gives a 0 percent weight for an assignment (typically hw or pgms indicating the class does not have those types of assignments), your program should not prompt the user to input a score that that assignment.
• Your program should not output any "impossible situations", for example, it should not say "You need a 120 on the final to get a B"
• Your program code and output should be nicely formatted and spaced out
To Turn in
Your submission document should have the following, in the order listed, and well labelled:
• Your program code
• An execution with the same input that I used for "Test Case 1"
• An execution with the same input that I used for "Test Case 2"
• An execution which implements the grading policy for this class using what you think your current scores/averages are
• Any other test cases you think you need to thoroughly test your
program (add a nonworking test case to ensure the program works)

User Rboarman
by
8.2k points

1 Answer

3 votes

Final answer:

This is a program that calculates grades based on user input of grading criteria and scores for different types of assignments. It then tells the student what their current grade is without the final exam, and what score they need on the final for various letter grades.

Step-by-step explanation:

Calculating Grades



In this program, you will prompt the user for the grading criteria for a class. Then, you will ask the user for grades/averages for the different types of assignments in the class, and calculate their current grade if they do not take the final. Finally, you will tell them what score they need on the final for various letter grades.



Here are a couple of test cases:



Test Case 1:



How many tests were given? 2

Percentage weight of Test 1: 5

Percentage weight of Test 2: 15

Percentage weight of Final: 20

Percentage weight of Homework (0 for no hw): 20

Percentage weight of Programs (0 for no pgms): 40

Test 1 score: 80

Test 2 score: 90

Homework Average: 99

Program Average: 88

Your current numeric score in the class (without the final) is 72.5

If you did not take the final, you would get a "C" in the class

To get a "B" in the class, you would need to score a 37 on the final

To get an "A" in the class, you would need to score a 87 on the final



Test Case 2:



How many tests were given? 2

Percentage weight of Test 1: 10

Percentage weight of Test 2: 10

Percentage weight of Final: 20

Percentage weight of Homework (0 for no hw): 20

Percentage weight of Programs (0 for no pgms): 40

Test 1 score: 60

Test 2 score: 62

Homework Average: 64

Program Average: 66

Your current numeric score in the class (without the final) is 51.4

If you did not take the final, you would get an "E" in the class

To get a "D" in the class, you would need to score a 43 on the final

To get a "C" in the class, you would need to score a 93 on the final

It is not possible for you to get an "A" or "B" in the course



Make sure to check the user-inputted percentages add up to 100, and handle cases where there is no homework or programs. Your program should also not output any "impossible situations". Format your code and output nicely.

User Lisa DeBruine
by
8.0k points