Hands On C++: Project 11


Objectives

1. Practice using enumerations.
2. Gain experience defining enumeration operations.

Introduction

Your instructor will tell you which one of the following projects to do.

Projects

11.1. Extend your Gender enumeration with these operations:

Write a driver program that tests your functions.

11.2. Build a Month enumeration. Using it, create a Date class that stores the month, day, and year for a date. Test your class by writing a program that reads two dates, and returns the number of days between those two dates (don't forget to consider leap years).

11.3. Extend the classes in enumGenerator.cpp to automatically generate the Next() and Previous() functions described in 11.1 for any enumeration.

11.4. Build two enumerations:

Use these enumerations to design and build a PlayingCard class. Using this class and vector, build a DeckOfCards class. Provide the following operations: Use these classes to write a program that plays a simple card game, such as "Go Fish."

Turn In: A hard copy of this grade sheet, attached to hard copies of

  1. all source files you created for this project; and
  2. the output from an execution of your executable program.

Don't forget to clean up your directory when you are all finished...


Back to the Lab Exercise

Back to This Lab's Home Page


Copyright 1998 by Joel C. Adams. All rights reserved.