Question: Looking for some help: Objective: Classes, objects, data members, member functions, and header files. . Problem Specification: Design a class that will do the following:

Looking for some help:

Objective: Classes, objects, data members, member functions, and header files. .

Problem Specification: Design a class that will do the following:

Accept a students name (string) and maintains an array of test scores (float). If there is room you can add a score at the first available position. That is the position immediately following the last added score. If the array is empty, you add at the first position. If the array is full, then you cannot add and must indicate that. If there are scores in the array, you can remove the last score; scores in the middle or front may not be removed. If the array is empty then you cannot remove and must indicate that. You can also clear the array of all the scores, but before you do that you must print the name and contents of the array backward.

Requirements:

Create a header file that contains the class declaration and interface for the class that will maintain objects of the class.

Define a default constructor that will ask for a student name to be entered from the keyboard and stores it.

It also initializes a counter that keeps track of the number of scores in the array and is maintained when you add, remove, or clear.

Define a null destructor.

The maximum number of test scores is 5 and is stored in the class data as a static constant.

The test scores may be integers, floats or doubles.

Two methods are defined to determine if the array isFull or isEmpty.

The file proj1.cpp is the client file that tests the methods defined in the implementation file and declared in the header file called proj1.h

Class templates are used to accommodate different types.

Accessor methods are constants and parameters passed are also constants

Clear method calls the print function which prints the array elements last to...

********Main file contains:

#include #include #include #include "proj1.h"

using namespace std;

int main(int argc, char** argv)

{ Student stud1; // a student char choice, answer; // handles input from menu and controls loop int score; // the iten to be added to the end of the array do { system("CLS"); // clears the screen cout <> choice; choice = toupper(choice); switch (choice) { case '1': case 'A': cout << " Add what Score "; cin >> score; if (stud1.add(score)) // call to the add method cout << score << " Added "; break; case '2': case 'R': if(stud1.remove()) // call to the remove method cout << " Removed "; break; case '3': case 'C': stud1.clear(); // call to the clear method break; } cout << "Another Operation (y/n): "; cin >> answer; answer = toupper(answer); }while (answer == 'Y'); cin.get(); return 0;

}

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!