Hands On C++: Project 12

The Projects

Your instructor will assign you one of the problems below. To solve your problem, write a program that reads the necessary information to compute and output the indicated values, as efficiently as possible. Following the pattern in the lab exercise, first, design using OCD; then code your design in C++ using stepwise translation; finally, test your program thoroughly.

Project #12.1: Extend your Gender enumeration with these operations: Write a driver program that tests your functions.

Project #12.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).

Project #12.3: Extend the classes in enumGenerator.cpp to automatically generate the Next() and Previous() functions described in the previous project for any enumeration.

Project #12.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

Turn the following things:

  1. This grade sheet.
  2. Your OCD.
  3. Your source program.
  4. The output from an execution of your program.

Lab Home Page | Lab Exercise
© 2003 by Prentice Hall. All rights reserved.
Report all errors to Jeremy D. Frens.