Your friend has asked you to help them with a project. He needs to calculate his grades, but is finding it difficult to operate a calcu- lator. Create a program which will accept an unlimited number of grades and calculates the average score. Assume each test is worth 100 points. Suggested letter grades scale of 90+ 'A, 80+ B, 70+ C, 60+ D , less than 60 are F.
// Specification C1 - Menu Driven Program
Create a numeric menu driven program. Figure 1 is an example of what this menu would look like. Add grade adds a student grade. Display all grades dumps all the scores to the console. Process all grades calculates the overall gpa for all the grades. The program continues to run until option 4 - quit, is selected.
// Specification C2 - Print Scores
Print all scores entered to screen when menu selection 2 is chosen.
// Specification C3 - Letter Grades
Include the letter grades for each individual test score you printed out under Specification C2.
// Specification C4 - Compute GPA
Compute the GPA (0-100%) for the client and display it when menu selection 3 is chosen.
// Specification B1 - Dynamic Array
Create an array on the heap. Store student scores in it.
// Specification B2 - Add Elements
Start your array at element 0 and increase it by one every time you add a new score with menu option 1.
// Specification B3 - Menu Input Validation
Only accept numbers in the range of valid inputs (1..4). Reject all other menu input and re-prompt.
// Specification B4 - Print Letter Grade
Print the letter grade for the overall gpa right next to the raw score when menu selection 3 is chosen. If it matters, assume a 4.0 scale.
// Specification A1 - Date class
Put all the date code in class Date class.
// Specification A2 - External date initialization
Set the data for your Date class externally, either through a setter method or a constructor.
// Specification A3 - Component Test Method in Date
Create a method in the date class which performs self diagnostics. That is, it instantiates a date object with known data and then compares the results with expected, correct, answers. Use this to demonstrate your input routines are working. Prove month, day, and year are indeed set correctly by A2 and the resulting output is formatted as expected.
// Specification A4 - Component Test Grade Conversion
Add a void UnitTest() function to your program. You can run A3 here, but also use this to verify your score to letter grade con- version function is working correctly. Prove each letter works right as well as error checking for too high and too low scores. Note: This implies your letter grade code is in a function.