Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

C++ CODING PROBLEM Provide two classes, GameEntry and GameScore, to maintain a list of top scores according to the requirements below. Each game entry (GameEntry)

C++ CODING PROBLEM

Provide two classes, GameEntry and GameScore, to maintain a list of top scores according to the requirements below. Each game entry (GameEntry) consists of a player name, a score (1 to 1000), and a date (mm/dd/yyyy). Include appropriate constructor(s), setters, and getters for class GameEntry. The game scores (GameScore) hold the name of the game and a list of up to top 10 scores by using a list of game entries (a current list might have fewer than 10 entries, but no more than 10 entries). A new game entry can be added if applicable (i.e., add to the list, replace an existing entry, or ignore for being too low). An existing game entry can be removed by specifying a ranking (e.g., specify rank 1 to remove highest score, specify rank 2 to remove second highest score, and so on; ignore invalid rank). A complete list of scores can be printed upon request (always from highest to lowest). In addition to appropriate constructor(s), setters, and getters, this class must support the following public operations: add(entry), remove(rank), and print(). Make sure to provide the two classes with basic operations described above and perform data validation as needed. Feel free to add additional classes and private operations as applicable. Each object of class GameScore can be used to keep track of the top 10 scores for a single game. Write a test driver (main) to test your classes (separate from your implementation file). You can use a menu or code various operations in your test driver. Be sure to test that all operations to make sure they work properly.

Here is one example:

g1 = new GameScore(Classic Pac-Man);

g1 (GameScore) g1.add(e1);// assume e1 (GameEntry):Jill 980 08/05/2017

g1.add(e2); // assume e2 (GameEntry):Jack 600 08/18/2017

g1.add(e3); // assume e3 (GameEntry): Rob 875 07/30/2017

g1.add(e4);// assume e4 (GameEntry): Rob 900 08/02/2017

g1.remove(2); // remove second highest score, Rob 900 g1.

print(); // print the following

Name: Classic Pac-Man

1 Jill 980 08/05/2017

2 Rob 875 07/30/2017

3 Jack 600 08/18/2017

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Oracle Databases On The Web Learn To Create Web Pages That Interface With Database Engines

Authors: Robert Papaj, Donald Burleson

11th Edition

1576100995, 978-1576100998

More Books

Students also viewed these Databases questions

Question

Use your knowledge to deal with requests, be precise and effective.

Answered: 1 week ago

Question

3. Develop a case study.

Answered: 1 week ago