create. dynamic gradebook

Write a gradebook program that lets a teacher keep track of test averages for his or her students. Your program should begin by asking the teacher for a few inputs that will be used to control how the system works. The program should begin by gathering the following information – all of this data must be validated:
Number of students in the class: must be positive, no upper limit
Number of tests in the class: must be positive, no upper limit
Extra credit mode: allows the teacher to enter in scores above 100 points. Valid inputs are “yes” or “no”
Drop lowest score mode: allows the system to drop the lowest score for each student. Valid inputs are “yes” or “no”. Note: this mode cannot be enabled if the teacher is only planning on inputting a single test.
Next, prompt the teacher to enter in scores for each student. Ensure that the test score values entered are within the range 0-100 (inclusive on both ends) if “extra credit mode” is turned off. If “extra credit mode” is turned on the upper limit is waived (the score must just be greater than or equal to zero. This data must be validated. Hint: you may need to use nested loops here! A “while” loop can be placed inside of a “for” loop, if necessary.
If “drop lowest score mode” is turned on the system should figure out the lowest score entered for each student, report it to the user and remove it from the grade calculation for the student.
You can assume that the user will enter integers when prompted (but they may not be within the range you are expecting, hence the need for validation)
Once your program has collected all test scores for a student it should display that student’s average formatted to 2 decimal places. The program should also compute the student’s letter grade using the following chart:
A: 90 or above
B: [80-90) – inclusive on the lower limit, exclusive on the upper limit
C: [70-80) – inclusive on the lower limit, exclusive on the upper limit
D: [63-70) – inclusive on the lower limit, exclusive on the upper limit
F: [0-63) – inclusive on the lower limit, exclusive on the upper limit
The program should then move onto the next student. When all students have been calculated the program should compute the overall average score for the entire class, along with a count of the letter grades earned by students in the class.
Here’s are a few sample runnings of your program (user input is highlighted):
How many students are in your class? 4

How many tests will you be giving in this class? 3

Is extra credit allowed? This will permit tests scores to exceed 100 points (yes/no): no

Would you like to drop the lowest test for each student? (yes/no): no

Thanks, here we go!

*** Student #1 ***
Enter score for test #1: -10
Score cannot be negative, try again.
Enter score for test #1: 105
Extra credit mode is not enabled, try again.
Enter score for test #1: 90
Enter score for test #2: 80
Enter score for test #3: 70

Average score for student #1 is 80.00 (B)

*** Student #2 ***
Enter score for test #1: 50
Enter score for test #2: 60
Enter score for test #3: 70

Average score for student #2 is 60.00 (F)

*** Student #3 ***
Enter score for test #1: 75
Enter score for test #2: -1
Score cannot be negative, try again.
Enter score for test #2: -2
Score cannot be negative, try again.
Enter score for test #2: -3
Score cannot be negative, try again.
Enter score for test #2: 85
Enter score for test #3: 90

Average score for student #3 is 83.33 (B)

*** Student #4 ***
Enter score for test #1: 90
Enter score for test #2: 95
Enter score for test #3: 89

Average score for student #4 is 91.33 (A)

—– REPORT —–
Overall class average: 78.67 (C)
# of students who earned an ‘A’ average: 1
# of students who earned an ‘B’ average: 2
# of students who earned an ‘C’ average: 0
# of students who earned an ‘D’ average: 0
# of students who earned an ‘F’ average: 1How many students are in your class? 4

How many tests will you be giving in this class? 3

Is extra credit allowed? This will permit tests scores to exceed 100 points (yes/no): yes

Would you like to drop the lowest test for each student? (yes/no): YES

Thanks, here we go!

*** Student #1 ***
Enter score for test #1: 90
Enter score for test #2: 80
Enter score for test #3: 50

Dropping the lowest test score for this student (50.0)
Average score for student #1 is 85.00 (B)

*** Student #2 ***
Enter score for test #1: 50
Enter score for test #2: 90
Enter score for test #3: 80

Dropping the lowest test score for this student (50.0)
Average score for student #2 is 85.00 (B)

*** Student #3 ***
Enter score for test #1: 75
Enter score for test #2: 85
Enter score for test #3: 75

Dropping the lowest test score for this student (75.0)
Average score for student #3 is 80.00 (B)

*** Student #4 ***
Enter score for test #1: 0
Enter score for test #2: 80
Enter score for test #3: 98

Dropping the lowest test score for this student (0.0)
Average score for student #4 is 89.00 (B)

—– REPORT —–
Overall class average: 84.75 (B)
# of students who earned an ‘A’ average: 0
# of students who earned an ‘B’ average: 4
# of students who earned an ‘C’ average: 0
# of students who earned an ‘D’ average: 0
# of students who earned an ‘F’ average: 0How many students are in your class? 3

How many tests will you be giving in this class? 1

Is extra credit allowed? This will permit tests scores to exceed 100 points (yes/no): no

Drop lowest test score mode turned off (only 1 test being entered)

Thanks, here we go!

*** Student #1 ***
Enter score for test #1: 105
Extra credit mode is not enabled, try again.
Enter score for test #1: 100

Average score for student #1 is 100.00 (A)

*** Student #2 ***
Enter score for test #1: 75

Average score for student #2 is 75.00 (C)

*** Student #3 ***
Enter score for test #1: 80

Average score for student #3 is 80.00 (B)

—– REPORT —–
Overall class average: 85.00 (B)
# of students who earned an ‘A’ average: 1
# of students who earned an ‘B’ average: 1
# of students who earned an ‘C’ average: 1
# of students who earned an ‘D’ average: 0
# of students who earned an ‘F’ average: 0How many students are in your class? -3
Invalid # of students, try again.
How many students are in your class? 3

How many tests will you be giving in this class? -3
Invalid # of tests, try again.
How many tests will you be giving in this class? 3

Is extra credit allowed? This will permit tests scores to exceed 100 points (yes/no): ?
Invalid choice, try again.
Is extra credit allowed? This will permit tests scores to exceed 100 points (yes/no): YES

Would you like to drop the lowest test for each student? (yes/no): ?
Invalid choice, try again.
Would you like to drop the lowest test for each student? (yes/no): NO

Thanks, here we go!

*** Student #1 ***
Enter score for test #1: 100
Enter score for test #2: 102
Enter score for test #3: 105

Average score for student #1 is 102.33 (A)

*** Student #2 ***
Enter score for test #1: 90
Enter score for test #2: 95
Enter score for test #3: 103

Average score for student #2 is 96.00 (A)

*** Student #3 ***
Enter score for test #1: 101
Enter score for test #2: 98
Enter score for test #3: 105

Average score for student #3 is 101.33 (A)

—– REPORT —–
Overall class average: 99.89 (A)
# of students who earned an ‘A’ average: 3
# of students who earned an ‘B’ average: 0
# of students who earned an ‘C’ average: 0
# of students who earned an ‘D’ average: 0
# of students who earned an ‘F’ average: 0Input assumptions:
Number of students in class: a value of data type ‘integer’ within the range -2147483648 to 2147483647
Number of tests in class: a value of data type ‘integer’ within the range -2147483648 to 2147483647
Extra credit mode: any string of length 0 to length ~infinity
Drop lowest score mode: any string of length 0 to length ~infinity
Individual test score: a value of data type ‘integer’ within the range -2147483648 to 2147483647
Some hints:
You can assume that the user will enter integers for the # of students and # of tests in the class, but you cannot assume the range of these integers.
You can assume the user will enter floating point numbers when prompted for a test score, but you cannot assume the range of these floating point values.
To collect student data you should probably begin by constructing a “for” loop to iterate over all students in the class
Once you’re inside of this “for” loop you will probably need another loop to handle inputting the scores for a particular student.
Big hint: Try to get your program to work first without any data validation. You can add this in later once you figure out the general structure of the program.
Remember the difference between “for” and “while” loops! “for” loops are used when you want to iterate over a know # of items, and “while” loops can be used to keep the user “caught” indefinately until they fulfill a particular condition. You will probably need to use a combination of these loops to solve this problem.
Accumulator variable placement is a critical part of this program. Remember that your accumulators should be placed outside of the loop they are being used in so that they don’t get overwritten each time the loop re-iterates. But some of your accumulators may need to be overwritten (i.e. each student probably needs their points earned to start at 0) – placement of some accumulators may be different depending on the purpose of each variable.

 

Looking for a Similar Assignment? Let us take care of your classwork while you enjoy your free time! All papers are written from scratch and are 100% Original. Try us today! Use Code FREE15