$30
Figure Skating Program Requirements
Task
Using Microsoft Visual Studio, write a program that keeps track of country names and scores
associated with an Olympics figure skating competition. The program should maintain a linked
list of country/score pairs, sorted in descending score order. The user is shown a menu with
options to add a node to the list, print the list, and exit the program.
You should create two C++ classes. One should be named Skater, with a declaration that looks
something like this:
class Skater {
public:
Skater(string c, float s);
string getCountry();
float getScore();
Skater *getNext();
void setNext(Skater *p);
private:
string country;
float score;
Skater *next;
};
The other class should be named List, and should manage a linked list of Skaters. The
constructor simply sets up an empty list. The destructor frees the dynamically-allocated
memory. A declaration for List might look like this:
class List {
public:
List();
void addNode(string country, float score);
void printList();
~List();
private:
Skater *head;
};
Submit a .zip file to Canvas that contains five files: main.cpp, skater.cpp, skater.h, list.cpp, and
list.h.
Example Output