C++ Data Structure
CSC 240
Lab 1
Option 1:
Complete the implementation of the Tic-Tac-Toe game. Use the provided header file: ticTacToe.h. Also,
use the provided driver file for testing purposes: ticTacToeDriver.cpp. These files can be found in the
Extra Files folder under Content in D2L.
Use the following code for your play function:
void ticTacToe::play() { bool done = false; char player = 'X'; displayBoard(); while (!done) { done = getXOMove(player); if (player == 'X') player = 'O'; else player = 'X'; } }
Option 2:
Complete the implementation of pointType and circleType. Use the provided header files:
pointType.h and circleType.h. Also, write a driver program for testing the implemented functionality of
the circleType class. Be sure to test all of the functions listed here: print, setRadius,
getRadius, getCircumference, getArea, circleType.
Add and implement the following function to the circleType class: setCenter.
Create a new class called Sphere that inherits the circleType class and has the following properties:
radius, center, z. Where radius is the radius of the Sphere, center stores the x and y-coordinates
as a pointType, and z is the z-coordinate of the Sphere. Complete the implementation of the Sphere
class and test it in the same driver used to test the circleType class.
Option 2 is useful for reviewing the concept of inheritance where one class (the derived class) inherits
properties of another class (the base class). In this case, the pointType class is the base class and the
circleType class is the derived class.