Question: Using C++ Write a class named TestScores. This class has a private array of test scores.. The constructor should accept an integer argument and dynamically

Using C++  Using C++ Write a class named TestScores. This class has a

Write a class named TestScores. This class has a private array of test scores.. The constructor should accept an integer argument and dynamically allocate the array to hold that many scores. The constructor stores the argument in the size attribute. The destructor should free the memory held by the array. In addition, there should be methods to perform the following operations: . Store a test score in a specified element of the array . Retrieve a test score from a specified element of the array . Return the highest score stored in the array . Return the lowest score stored in the array . Return the average of all scores stored in the array Your class should be implemented using the following UML diagram TestScores scores: int size: int +TestScores(s: int): TestScores) +setScore(i: int, s: int): void getScore(i: int): int getAverage0: double getHighScore): int getLowScore(): int The class itself must not interact with the user in any way. All accessors should be marked const. size stores the number of elements in the array. scores is a pointer that stores the memory address for the array. Do not use global variables. Your program should ask the user how many scores they want to store and then ask the user for each score and store it in a TestScores object. The program should then display all the scores, their average, the high score, and the low score

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!