1. Write a grading program for a class with the following grading policies: a. T
ID: 3652344 • Letter: 1
Question
1.
Write a grading program 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 midterm exam and one final exam, each graded on the basis of 100 points.
c. The final exam counts for 50% of the grade, the midterm counts for 25%, and the two quizzes together count for a total of 25%. (Do not forget to normalize the quiz scores. The should be converted to a percent before they are averaged in.)
Any grade of 90 or more is an A, any grade of 80 or more (but less than 90) is a B, any grade of 70 or more (but less than 80) is a C, any grade of 60 or more (but less than 70) is a D, and any grade below 60 is an F.
The program will read in the student's scores and output the student's record, which consists of two quiz and two exam scores as well as the student's average numeric score for the entire The input/output should be done with the keyboard and screen. course and the final letter grade.
Input to the program will be a text file, in which each line provides the ID number, quiz #1 grade, quiz #2 grade, midterm exam grade and final exam grade for one student.( I have the file, so i am asking if the program can be written as if it is getting input from a file)
2.
redo programming project 1 (or do it for the first time), but this time make the student record type a class type rather than a structure type. the student record class should have member variables for all the input data described in programing project 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 students 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 students final letter grade and sets the corresponding member variable.
Explanation / Answer
#include using namespace std; struct record //contains values that are recorded { double quiz1; double quiz2; double midyear, midyear_one; double final, final_one; double quiz_average; char final_grade; double total_grade; }; void instructions(); //post condition: Displays instructions void input(record& the_grades); //pre condition: gets the grades for quiz 1,quiz 2, midyear exam and final //post condition: sets the variables in structure void output(record& the_grades); // pre-condition: calculates the final grade and gets the letter grade // post condition: outputs the grades to the user int main() { char run_again; // variable to allow user to run program again record grades; instructions();// outputs instructions do { input(grades); // gets grades output(grades);// outputs the values coutRelated Questions
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.