CS 311 Fall 2024  >  Assignment 1


CS 311 Fall 2024
Assignment 1

Assignment 1 is due at 5 pm Tuesday, September 10. It is worth 60 points.

Procedures

This assignment is to be done individually.

Turn in answers to the exercises below on the UA Canvas site, under Assignment 1 for this class.

Exercises (60 pts total)

Exercise A — “Player” Class

Purpose

In this exercise, you will write a simple class of the kind that might have been done as an exercise in operator overloading in CS 202. However, a number of the concepts covered in CS 311 will need to be applied. Most importantly, quality standards will be quite high. In particular, your code will need to work with a provided test program, passing all tests.

Instructions

Implement a C++ class that holds information about a player in some game: the player’s real name and username, and the number of games they have played.

Be sure to follow the coding standards. You do not need to follow the standards in part 4 (“Additional Standards”); these come later.

Other Requirements

Test Program

A test program is available: player_test.cpp. If you compile and run the test program (unmodified!) with your code, then it will test whether your code works properly.

The test program requires doctest.h, the header for the doctest unit-testing framework, version 2. This file may be downloaded from the doctest GitHub site.

Do not turn in the test program or the doctest framework.

Note. The test program cannot check the following completely, but you still need to do them correctly.

Thoughts