Make short program to help your instructor gather information about midterm marks (this will be fictional). Your
Fantastic news! We've Found the answer you've been seeking!
Question:
Make short program to help your instructor gather information about midterm marks (this will be fictional).
Your program will use loops and conditionals to count the number of each grade letter (A, B, C, D, and F) in a list of midterm marks.
Letter | Mark |
---|---|
A | 80-100 |
B | 70-79 |
C | 60-69 |
D | 50-59 |
F | 0-49 |
The following list of midterm marks should be used:
midtermMarks = [48.0, 64.25, 71.80, 82.0, 53.45, 59.75, 62.80, 26.5, 55.0, 67.5, 70.25, 52.45, 66.25, 94.0, 65.5, 34.5, 69.25, 52.0]
Strategy
- Create five variables, one for each grade letter.
- Loop through all of the midterm marks, and use conditionals to determine which grade letter corresponds to each midterm mark.
- Finally, print the number of each grade letter after the loop has finished.
Your program should work for any list of midterm marks. The output of this program, for the given midterm mark values, should be:
Number of As: 2 Number of Bs: 2 Number of Cs: 6 Number of Ds: 5 Number of Fs: 3
Each of the results should be printed in a new line. The spacing in between the lines is not neccessary.
[ ]:
# the given data midterm Marks = [48.0, 64.25, 71.80, 82.0, 53.45, 59.75, 62.80, 26.5, 55.0, 67.5, 70.25, 52.45, 66.25, 94.0, 65.5, 34.5, 69.25, 52.0]
Related Book For
Java An Introduction To Problem Solving And Programming
ISBN: 9780134462035
8th Edition
Authors: Walter Savitch
Posted Date: