EECS168 09:Homework5
| Navigation | 
|---|
| Home | 
| Information | 
| Classwork | 
Overview
You are going to write a program that calculates a student's grade with multiple functions that use call-by-reference parameters. You are going to use the concept of testing and debugging of functions and write a driver program and a program involving stubs.
DUE DATE: The electronic submission of your homework must be received before 11:59 pm, Tuesday, 10th of March.
Problem Description
In order to calculate the grades, following weighted grade scheme should be used:
- 30% of the grade is exams
 - 20% of the grade is quizzes
 - 20% of the grade is homework
 - 30% of the grade is the final exam
 
These distributions should be enforced no matter how many exams, quizzes, or homework projects there are. To do this, you need a weighted average. Get the exam grade by finding the average of all exam grades. Get the quiz and homework grades the same way. Then the class grade is computed:
- Class Grade = (0.3 * Exam Average) + (0.2 * Quiz Average) + (0.2 * Homework Average) + (0.3 * Final Exam)
 
Finally, the class grade should be converted to a letter grade. This should be the normal 90/80/70/60 scheme, i.e.:
- A: Class Grade >= 90.0
 - B: Class Grade >= 80.0
 - C: Class Grade >= 70.0
 - D: Class Grade >= 60.0
 - F: Class Grade < 60.0
 
Program Requirements
Name your source code file StudentGrade.cpp. In writing the program you should satisfy following requirements.
- The program should prompt the user for four types of scores: exams, homeworks, quizzes and the final exam.  All scores are assumed to be out of 100.
- There will be 3 Exams, 5 Homeworks, 4 Quizzes and 1 Final Exam .
 
 - The program should display the average score for each type.
 - The program should display the Final Grade and its corresponding letter grade.
 - The main() function should be only the driver of the program, meaning that main would have very little code and it will be only making function calls to the functions you will write.
 - Your functions should only be using call-by-reference.
 - You will be writing 10 functions with the specified names. Here is a list of them:
- GetExamScores()
- Return Type: None(void)
 - This function is to get all the three exam scores.
 
 - GetHWScores()
- Return Type: None(void)
 - This function is to get all the Five Homework scores.
 
 - GetQuizScores()
- Return Type: None(void)
 - This function is to get all the Four Quiz scores.
 
 - GetFinalExamScore()
- Return Type: None(void)
 - This function is to get the Final Exam Scores.
 
 - ExamAverage()
- Return Type: None(void)
 - This function is to compute the Exam Average.
 
 - HWAverage()
- Return Type: None(void)
 - This function is to compute the Homework Average.
 
 - QuizAverage()
- Return Type: None(void)
 - This function is to compute the Quiz Average.
 
 - FinalWeightedGrade()
- Return Type: None(void)
 - This function is to compute the Final Weighted Score based on the given weighted grading scheme.
 
 - LetterGrade()
- Return Type: char
 - This function is to compute the Letter grade based on the Final Weighted Grade.
 - You have a choice to implement this function as either pass-by-value or pass-by-reference
 
 - Display()
- Return Type: None(void)
 - This function is to display the computed Exam, Homework, Quiz Averages, Final Weighted Grade and the letter Grade of the student.
 
 
 - GetExamScores()
 - Atleast 'Four of the above functions should be functions that call another functions.
 
Example Program Execution
The following is an example of what a program run should look like. The user's input is shown in bold.
- Note: The precision with which the results should be outputted is different for different outputs. Implement the precision of the computed results as per the sample execution.
 
- The Grade is based on four types of work: Exams, Homeworks, Quizzes and Final Exam.
 
- Enter all the Exam Scores
 - Exam1: 88
 - Exam2: 91
 - Exam3: 85
 
- Enter all the Homework Scores
 - Homework1: 93
 - Homework2: 96
 - Homework3: 89
 - Homework4: 100
 - Homework5: 97
 
- Enter all the Quiz Scores
 - Quiz1: 86
 - Quiz2: 93
 - Quiz3: 95
 - Quiz4: 91
 
- Enter the Final Exam Score: 89
 
- *******************The Grade Report**********************
 
- The Average of the Exams is 88.00
 - The Average of the Homeworks is 95.00
 - The Average of the Quizzes is 91.25
 - The Final Exam Score is 89.00
 
- The Final Grade for the Course is 90.3
 - The Final Letter Grade is A
 
Testing and Debugging Functions
- Write a Driver Program, test_GetExamScores.cpp to test your GetExamScores() function.
 - Write a program with stubs, test_Display.cpp to test your Display() function.
 - To read more about Testing and Debugging of Functions refer to page 282 of your book.
 
Notes
- Your source code files should have comments at the top with:
- your name
 - the class ("EECS 168")
 - the assignment name (i.e., "Homework 5")
 - the date
 - an explanation of what the code is supposed to do
 
 - You should have comments in the code that explain what the code is doing.
 
Additional Requirements For EECS 169 Students
- Allow the program to ask the user to compute another student's grade.
 - Write a function Feedback()
- Based on Exam Average as criteria, if the student attains any grade other than A, this function should compute and display the Exam Average that would have earned them an upper letter Grade.
 - If there is no scope for a better Exam Average, i.e, Student has to attain more than 100 (which is not possible)to get an upper letter grade then just display a feedback "Requires more effort in all the types of work".
 - You have choice to implement this function using call-by-value or call-by-reference.
 
 
Submission
The files you should submit electronically (in a tarball) are:
- StudentGrade.cpp: Your source code.
 - testing.txt: The testing you did on your finished StudentGrade.cpp program.
 - test_GetExamScores.cpp
 - test_Display.cpp
 
- The subject of your e-mail should be '[EECS 168] Homework 05'