Program file containing game scores

User Generated

ChcclOnex

Programming

Description

The purpose of this assignment is to maintain a list of 10 highest scores for some game. The assignment requires building and using two libraries and reading and writing a binary file. The program will make use of an input file containing game scores.

Program Requirements

The Date Library

The Date library should contain a Date class. The Date class should contain a time_t data member to store the date.
The Date class should contain
  • 4 constructors:
    • Date();
    • Date(const Date&) = default;
    • Date(time_t); // Date in time_t format
    • Date(const char*);
  • The default constructor should create a Date object containing the current date.
  • Date(const char*) constructor should accept arguments with date formats of "mm/dd/yy", or "mm-dd-yy" or "ddmonyy"
  • The Date library should also contain an overloaded insertion operator to display Dates.
  • You may add any other member function necessary for the Date class.

The Score library

The Score library should contain a Score class and an overloaded insertion operator to display Score objects.
The Score class shold contain
  • 3 data members:
    • char name[16];
    • int score;
    • Date date;
  • One or more constructors
  • Accessor functions
  • An overloaded < operator function. You'll need this to sort the Scores.

What needs to be submitted:

  1. All of the sources files and header files for the libraries and the application. Do not include project files, object files, library archives or executables.
  2. An output file of the assignment results. It should look like that attached
  3. A screen image showing the assignment application build, including compilation and linking options.

Unformatted Attachment Preview

Input file: Gertrude Mac the Knife Luke Skywalker Harry S Truman Martha Clyde Clyde Mick Jagger Gertrude C3P0 Mac the Knife Bonnie Bonnie Bonnie Luke Skywalker Gertrude Patsy Cline Donald Trump Shirley Temple R2D2 08Aug05 06Aug14 10/19/06 09/11/17 1325122744 04Nov03 04/07/07 07-28-15 05-11-13 25Apr12 15Sep13 05-08-03 08-09-02 1468105119 1339870634 34 82 59 52 30 98 31 7 45 32 67 96 50 77 8 22 1 26 69 4 Binary file: The Scores data must be stored in a binary file in sorted order. A maximum of 10 highest scores will be stored in the binary file. The binary file should be read in before each record in the input file is processed. The binary file should be written each time a new score is inserted into the list of highest scores. Sample main: int main() { Score scores[MaxNumberOfScores]; ifstream fin(InputFile); if (!fin) { cerr
Purchase answer to see full attachment
User generated content is uploaded by users for the purposes of learning and should be used following Studypool's honor code & terms of service.

Explanation & Answer

Use this o...


Anonymous
Awesome! Made my life easier.

Studypool
4.7
Indeed
4.5
Sitejabber
4.4

Related Tags