Academic Integrity: tutoring, explanations, and feedback — we don’t complete graded work or submit on a student’s behalf.

I have written part of the program nut got stuck on the student class. You must

ID: 3648321 • Letter: I

Question

I have written part of the program nut got stuck on the student class.

You must create the following classes which will be used to compute a student's final course grade (for an example class):
Exam
Coursework
Student

The Exam class represents the percentage (score) and letter grade (grade) received for an exam. It must:
-have a private instance variable that keeps track of an integer score
- have a private instance variable that keeps track of a letter grade (as a string)
- have a constructor which takes two arguments, an int and a String, which are used to populate the instance variables (due to possible curves for exam scores, the integer score may not match the typical letter grade)
- have ``get'' functions to get the score and grade
-ensure that scores are between 0 and 100 (if a score less than 0 is used, it should be rounded up to 0, if a score greater than 100 is used it should be rounded down to 100)
- ensure that the letter grade is either A, B, C, D, or F. If a value other than those is used, a warning message should be printed to the console that an invalid grade was entered, and the value ``F'' should be used.

The Coursework class represents the combined scores for a collection of similar work such as homework or in-class activities. It must:
- have a private instance variable that keeps track of the total (sum) of the scores
- have a private instance variable that keeps track of the number of scores that have been totaled
- have a function that allows you to add a score
- have a function that returns the average of the scores as a double

The Student class represents a student and is used to for entering grades and computing and printing the final course grade. It must:
- have a private instance variable that keeps track of the student's first name as a string (and one for the last name)
- have a private instance variable of type Exam that keeps track of the student's midterm exam score and grade (and one for the final exam)
- have a private instance variable of type Coursework that keeps track of the student's homework total (and one for in-class activities)
- have a constructor which takes 2 String arguments, one for the first name and one for the last name (in that order)
- have the following member functions (implemented):
public void setMidterm(int score, String grade)
public void setFinal(int score, String grade)
public void addGradedHomework(int score)
public void addGradedActivity(int score)
public void printGrade()
- calculate and output the student's final course grade when printGrade() is called as follows:
The weighted course percentage should be computed as follows: (activity average * 15%) + (homework average * 25%) + (midterm score * 25%) + (final score * 35%)
Based on the weighted course percentage, a letter grade should be computed as: F (<60), D (>=60, <70), C (>=70, <80), B (>=80, <90), A (>=90)

Follow the formula strictly (i.e. a score of 79.88% is a C and doesn't round to 80% and a B).

Because the professor thought that performance on the exams was low, he curved them so that the percentages for exams don't necessarily align with the letter grades for them. Also, since the exams were difficult, he decided that no student's final course grade would be lower than the lowest letter grade they received on an exam. Therefore, if their weighted percentage puts them in a grade category lower than that of their lowest exam, their course grade should be adjusted upward to match that of their lowest exam grade.

The student's full name along with their final letter grade and weighted percentage (between 0 and 100, rounded to exactly two decimal places) must be output to the console. The output line must begin with "Final course grade for" and then include the studen'ts name, letter grade, and percentage.

Explanation / Answer

Here is the program description: 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 program will read in the students’ scores and output the student’s numeric score for the entire course. The program will display the average of the quizzes, tests, and the total score before it terminates. A session with the program might look like this: Enter the student's name: Mike Fisher Enter the student's grade for quiz #1: 8 Enter the student's grade for quiz #2: 9 Enter the student's grade for midterm: 89 Enter the student's grade for final: 98 Mike Fisher's numeric score for the entire course is 92.5 Would you like to enter another student record? y(yes) or n(no)?y Enter the student's name: Jon Stewart Enter the student's grade for quiz #1: 7 Enter the student's grade for quiz #2: 8 Enter the student's grade for midterm: 78 Enter the student's grade for final: 84 Jon Stewart's numeric score for the entire course is 80.25 Would you like to enter another student record? y(yes) or n(no)?n The average score on quiz1 is 7.5 The average score on quiz2 is 8.5 The average score on midterm is 83.5 The average score on final is 91 The average score for the entire course is 86.375 Specifications: 1. The program should be built around an array of structures, with each structure containing information of a student’s record, including name (a string), quiz 1 score, quiz 2 score, midterm score, and final score (all scores are of type int) 2. To read in a student’s name, use the version of read_line function that skips white-space characters before it begins storing characters. 3. The program should have a loop that continues as long as the user wants to enter another student’s record. 4. Assume that there are no more than 100 students. 5. Assume that each student’s name is no more than 50 characters long. I would like to figure out how to get the following output: The average score on quiz1 is 7.5 The average score on quiz2 is 8.5 The average score on midterm is 83.5 The average score on final is 91 The average score for the entire course is 86.375 I have been able to get the average numerical scores, but I want to be able to get the average quiz1 score, quiz2 score, midterm, final, and entire course course once I type n (for no). How could I possibly do it? #include #include #define NAME_LEN 50 #define STUD_LEN 100 int read_line(char str[], int n); int find_students(int students); struct test_result { char name[NAME_LEN+1]; int number; int grade1; int grade2; int midterm; int final; float numeric; }studen[STUD_LEN]; void insert(void); void print(void); int num_students = 0; int main(void) { struct test_result test; printf("Enter the student's name: "); read_line(test.name, NAME_LEN); printf("Enter the student's grade for quiz #1: "); scanf("%d", &test.grade1); printf("Enter the student's grade for quiz #2: "); scanf("%d", &test.grade2); printf("Enter the student's grade for midterm: "); scanf("%d", &test.midterm); printf("Enter the student's grade for final: "); scanf("%d", &test.final); test.numeric = (((test.grade1 + test.grade2) * 1.25) + (test.midterm * 0.25) + (test.final * 0.50)); printf("%s's numeric score for the entire course is %.1f ", test.name, test.numeric); char code; for (;;) { printf(" "); printf("Would you like to enter another student record? y(yes) or n(no)?"); scanf(" %c", &code); while (getchar() != ' ') /* skips to end of line */ ; switch (code) { case 'y': insert(); break; case 'n': print(); return 0; default: printf("Invalid entry. Try again. "); return 0; } } } int find_students(int students) { int i; for (i = 0; i