Question: I need it in only these 4 files please : TestScore.h TestScore.cpp NegativeScore.h TestScoreWithTryCatch.cpp 16-7. TestScores Class Write a class named TestScores: One of the

I need it in only these 4 files please :

TestScore.h TestScore.cpp NegativeScore.h TestScoreWithTryCatch.cpp

16-7. TestScores Class

Write a class named TestScores:

One of the class constructors should accept an array of test scores and a variable containing the size of the array as its arguments.

The class should have a member function (getAverage()) that returns the average of the test scores.

If any test score in the array is negative or greater than 100, the class should throw an exception.

Write a class named NegativeScore:

This class will be used as the variable type in the catch(NegativeScore BadScore) statement.

It should have a constructor (int score).

It should also have a getScore() member.

Suggestion: Write a program to test the Try/Catch statements by defining an array of:

Good scores, int myScores[NUM_SCORES] = { 88, 90, 93, 87, 99 };

Bad scores, int badScores[NUM_SCORES] = { 88, 90, -99, 87, 99 };

Submit the following files: TestScore.h TestScore.cpp NegativeScore.h TestScoreWithTryCatch.cpp

Sample output: The average score is 91.4 An invalid score was found. The invalid score is -99 Press any key to continue . . .

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!