Problem:
Write a grading program (C++) for a class with the following
grading policies:-
a. There are two quizzes, each graded on the basis of 10
points.
b. There is one test and one final test, each graded on the basis
of 100
points.
c. The final test counts for 50 percent of the grade, the other
test counts for 25 percent
and the two quizzes together count for a total of 25 percent.
Grading system is as follows:-
>90 A
>=80 and <90 B
>=70 and <80 C
>=60 and <70 D
<60 E
The program should read in the student's scores and output the
student's record, which
consists of two quiz and two test scores as well as the student's
average numeric
score for the entire course and the final letter grade. Define and
use a structure for the
student record.
Utilize these function prototypes:-
void input(StudentRecord& student); //should prompt for input
for one student and
set the structure variable members.
void computeGrade(StudentRecord& student); //use this to
calculate the numeric
average and letter grade.
void output(const StudentRecord student); //outputs the student
record.
Sample Output:-
Sample data for the test run:-
1 7 10 90 95
2 9 8 90 80
3 7 8 70 80
4 5 8 50 70
5 4 0 40 35
Output:
enter the student number: 1
enter two 10 point quizes
7 10
enter both test grades. These are 100 point tests
90 95
enter the student number: 2
enter two 10 point quizes
9 8
enter both test grades. These are 100 point tests
90 80
enter the student number: 3
enter two 10 point quizes
7 8
enter both test grades. These are 100 point tests
70 80
enter the student number: 4
enter two 10 point quizes
5 8
enter both test grades. These are 100 point tests
50 70
enter the student number: 5
enter two 10 point quizes
4 0
enter both test grades. These are 100 point tests
40 35
The record for student number: 1
The quiz grades are: 7 10
The test grades are: 90 95
The numeric average is: 91.25
and the letter grade assigned is A
The record for student number: 2
The quiz grades are: 9 8
The test grades are: 90 80
The numeric average is: 83.75
and the letter grade assigned is B
The record for student number: 3
The quiz grades are: 7 8
The test grades are: 70 80
The numeric average is: 76.25
and the letter grade assigned is C
The record for student number: 4
The quiz grades are: 5 8
The test grades are: 50 70
The numeric average is: 63.75
and the letter grade assigned is D
The record for student number: 5
The quiz grades are: 4 0
The test grades are: 40 35
The numeric average is: 32.5
and the letter grade assigned is F
Rewrite the program you wrote in Problem 1, this time make the
StudentRecord type
a class type rather than a struct. The student record class should
hav member
variables for all input datadescribed in Problem 1 and a member
variable for the
student's weighted average numeric score for the entire course as
well as a member
variable for the student's final letter grade. Make all member
variables Private. Include
member functions for each of the following member functions to set
each of the member
variables to values given as an argument(s) to the function, member
functions to
retrieve the data from each of the member variables, a void
function that calculates the
student's weighted average numeric score for the entire course and
sets the
corresponding member variable and a void function that calculates
the student's final
letter grade and sets the corresponding member variable.
Problem: Write a grading program (C++) for a class with the following grading policies:- a. There are two quizzes, each
-
- Site Admin
- Posts: 899603
- Joined: Mon Aug 02, 2021 8:13 am