Question: PLEASE DO THE CODE IN C++ USING THE EXACT SAME STEPS IN THE PICTURE INSTRUCTIONS. AND PLEASE FOR THE ADD AND REMOVE FUNCTION PLEASE USE



PLEASE DO THE CODE IN C++ USING THE EXACT SAME STEPS IN THE PICTURE INSTRUCTIONS. AND PLEASE FOR THE ADD AND REMOVE FUNCTION PLEASE USE SINGLY LINKED LIST IN THE MOST BASIC WAY. AND PLEASE EXPLAIN STEP BY STEP.
1. GameEntry class Member variables: - string: name - int: score Member functions: - GameEntry(const string\& n=" ", int s=0 ) - GameEntry() - string getName() const; - int getScore(); Access type - member variables: private - member functions: public 2. GENode class Member variables: - GameEntry elem; //data - GENode *next; //pointer to the next node Member functions: - No member functions Access type - Private 3. Scores class Member variables: Since in this case we are going to use singly linked list, the member variables are not the same as the implementation in the book. And will depend on the implementation that you are going to define. One option can be as below: - int maxEntries; // maximum number of entries - int numEntries; // actual number of entries - GENode* head; // head of the singly linked list - GENode* tail; //end of the singly linked list Member functions: - Scores(int maxEnt = 10); - SScores() - void add(const GameEntry\& e) - GameEntry remove(int i) throw(IndexOutOfBounds) - void printAll(); //prints all the game entries in the list Access type Member functions: public Member variables: private Answer questions below before implementing: Why member functions are public? Why data members are private? 4. It is up to you 5. Main Write the main function in a separate file. Test Scores operations in the main function Include necessary files in main.cpp file Inside the main function: Create an object of type Scores, with maxEntries = 5; Add 4 GameEntry items with diff score min 5. Print all. Add 3 other GameEntry with scores between the first 4. Print all. Remove the first GmeEntry. Print All
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
