Question: Assignment 3 : Game Scores Management with Singly Linked List ( Without User Input ) Develop a C + + application to manage the top
Assignment : Game Scores Management with Singly Linked List Without User Input
Develop a C application to manage the top game scores using a singly linked list,
implementing add and remove functionalities. This includes creating a GameEntry
class, a GENode class for the linked list structure, and a Scores class to manage
the game entries. The singly linked list will have a maximum number of elements
it can hold maxEntries data member
Part : Implementation
### GameEntry Class Implementation
Create a class GameEntry to store game entries.
#### GameEntry.h Header File
Member Variables Private:
std::string name; Player's name
int score; Player's score
Member Functions Public:
GameEntryconst std::string& n int s; Constructor
std::string getName const; Get player nAssignment : Game Scores Management with Singly Linked List Without User Input
Develop a C application to manage the top game scores using a singly linked list,
implementing add and remove functionalities. This includes creating a GameEntry
class, a GENode class for the linked list structure, and a Scores class to manage
the game entries. The singly linked list will have a maximum number of elements
it can hold maxEntries data member
Part : Implementation
### GameEntry Class Implementation
Create a class GameEntry to store game entries.
#### GameEntry.h Header File
Member Variables Private:
std::string name; Player's name
int score; Player's score
Member Functions Public:
GameEntryconst std::string& n int s; Constructor
std::string getName const; Get player name
int getScore const; Get player score
void setNamestd::string nName; Set player name
void setScoreint nScore; Set player score
#### GameEntry.cpp Implementation File
Implement the functions declared in GameEntry.h
### GENode Class Implementation
Develop GENode with the following structure to represent a node in the singly linked list.
#### GENode.h Header File
Member Variables Private:
GameEntry elem; Game entry stored in the node
GENode next; Pointer to the next node
Member Variables Public:
static int activeNodes; Static variable to track number of active nodes
Member Functions Private:
Inside the body of the constructor increment activeNodes by one
when a node is created
GENodeconst GameEntry& e GENode n nullptr; Constructor
Member Functions Public:
Inside the body of the destuctor decrement activeNodes by one
when a node is destroyed
~GENode;
### Scores Class Implementation
Construct Scores to manage a list of GameEntry objects using a singly linked list.
#### Scores.h Header File
Member Variables Private:
int maxEntries; Maximum number of entries
int numEntries; Current number of entries
GENode head; Head of the list
GENode tail; Tail of the list
Member Functions Public:
Scoresint maxEnt ; Constructor
~Scores; Destructor
void addconst GameEntry& e; Add a game entry
GameEntry removeint i throwIndexOutOfBounds; Remove a game entry
void printAll; Print all game entries
bool empty const; returns true if the list is empty and false otherwise
int size const; returns current number of entries in the list
int capacity const; returns max number of entries allowed in the list top
#### Scores.cpp Implementation File
Implement the functions declared in Scores.h
### Exception Handling Implementation
Utilize RuntimeException and IndexOutOfBounds classes for handling exceptions.
### Main Function Implementation
Implement the main function in a separate cpp file maincpp to demonstrate
the functionality of the Scores class.
#### main.cpp
Include the necessary files
Initialize the static variable activeNodes with before main function
example code:
#include
int GENode::activeNodes ;
int main
Implement the main function
#### Main Function Details
Create an object of type Scores, with maxEntries
Add GameEntry items with different scores, minimum score of
Print all entries.
Add other GameEntry items with scores interspersed among the first
Print all entries after additions.
Remove the first GameEntry item.
Print all entries after removal.
Explain each step thoroughly
Step by Step Solution
There are 3 Steps involved in it
1 Expert Approved Answer
Step: 1 Unlock
Question Has Been Solved by an Expert!
Get step-by-step solutions from verified subject matter experts
Step: 2 Unlock
Step: 3 Unlock
