Advanced C++

Advanced C++

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.

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.
THE 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.

Advanced C++

Last Updated on February 10, 2019

Don`t copy text!
Scroll to Top