For this program, you are going to modify your previous program so that it will
ID: 3532724 • Letter: F
Question
For this program, you are going to modify your previous program so that it will now read multiple inputs for each homework assignment (you will need to have a flag to end inputting assignments), upto 3 parts for the midterm exam instead of 1 midterm exam score and exactly two parts for the final exam. It will then calculate the letter grade of the class.
The weight of the assignments and exams are still the same, except that the maximum score will now differ.
You will write different functions for this program, as follows:
Your function to read all the assignments should do the following:
Until the user indicates that they have finished inputting data, you should read the score for each homework assignment and the maximum possible score for each assignment. Once the user has finished inputting the data, you then need to calculate the weighed score for the homework assignments.
Eg: assume that these values were input:
21 out of 25 possible points
30 out of 30 possible points
10 out of 12 possible points
55 out of 60 possible points
Then your total would be 116 out of 127 possible points. In which case, your weighted score would be 45.67 (116*50/127).
Explanation / Answer
Your function to read all the assignments should do the following: Until the user indicates that they have finished inputting data, you should read the score for each homework assignment and the maximum possible score for each assignment. Once the user has finished inputting the data, you then need to calculate the weighed score for the homework assignments. Eg: assume that these values were input: 21 out of 25 possible points 30 out of 30 possible points 10 out of 12 possible points 55 out of 60 possible points Then your total would be 116 out of 127 possible points. In which case, your weighted score would be 45.67 (116*50/127) Your function to read all the grades for the midterm should do the following: Until the user indicates that they have finished inputting data OR you have read 3 data values (whichever comes first) you should read the score for each part of the midterm exam and the maximum possible score for each part. Then you need to calculate the weighed score for the midterm exam. Eg: assume that these values were input: 21 out of 25 possible points 30 out of 30 possible points 10 out of 12 possible points Then your total would be 61 out of 67 possible points. In which case, your weighted score would be 18.21 (61*20/67). Your function to read all the grades for the final exam should do the following: You read exactly 2 data values for the final exam along with the maximum possible score for each part. Then you need to calculate the weighed score for the midterm exam. Eg: assume that these values were input: 21 out of 25 possible points 30 out of 30 possible points Then your total would be 51 out of 55 possible points. In which case, your weighted score would be 27.82 (51*30/55). Your function to calculate the letter grade should do the following: You get the total score for the class and calculate the letter grade using the following formula: 90-100 A 80-89 B 70-79 C 60-69 D A The output should look like the following (for the example given above): Final exam score was 27.82 Midterm exam score was 18.21 Homework assignments score were 45.67 Total score is 91.7 Grade for the class is ARelated Questions
drjack9650@gmail.com
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.