Please some help here:
This is for an ADT program based on Classes. (ArrayBag)
CREATE:???? A HEADER FILE proj1.h (that CONTAINS CLASS declaration)
????????????????????? THE INTERFACE CLASS????? and
????????????????????? the implementation file BASED ON THE FOLLOWING FILE:
********Main file contains:
#include <iostream>
#include <string>
#include <iomanip>
#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 < ??? cout << setw(15)<< ” “<< “(1)- (A)ddnn”;
??? cout << setw(15)<< ” “<< “(2)- (R)emove nn”;
??? cout << setw(15)<< ” “<< “(3)- (C)learnnn”;
??? cout << setw(35)<< “Enter Choice: “;
??? cin >> choice;
??? choice = toupper(choice);
??? switch (choice)
??? {?? case ‘1’:
??????? case ‘A’:
??????????????? cout << “nAdd what Score “;
??????????????? cin >> score;
??????????????? if (stud1.add(score))?????? // call to the add method
??????????????????? cout << score << “nnAddednn”;
??????????????? break;
??????? case ‘2’:
??????? case ‘R’:
??????????????? if(stud1.remove())????????? // call to the remove method
??????????????????? cout << “nnRemovednn”;
??????????????? 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;??
}
Problem Specification:
The class that will do the following:
default constructor accepts a student?s 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.
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. (Template class) Optional, I can fix it myself
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…
Thanks