A sample programming project for users of C++ and Object-Oriented Programming, by Kip Irvine.
Problem Statement:
The New Hope Health Clinic* has asked for your help in creating a computer program that tracks immunization schedules for children in the nearby neighborhood. The clinic currently has 300 patients, and this number is expected to increase to 500 over the coming year. The tracking system must be interactive, so nurses and doctors can immediately patient information when one receives a shot. On demand, the system must provide a list of patient names and phone numbers for those who will require immunizations within the next two weeks. The clinic will use this list to call patients and remind their parents to bring them in. The system must also be able to produce a report listing all patients whose immunizations are overdue.
The clinic's director wants the program to be object oriented, and insists that the program be written in C++. A console-based user interface is acceptable for the time being, with the understanding that the program will be implemented with a graphical interface at a later date.
Patient File:
Each field in this text file is placed on a separate line, and each patient record ends with the "//" on a line by itself. All dates are in mm/dd/yyyy format. All phone numbers include an area code.
Immunization Rules:
The following rules are only a sample, and are a simplification of the existing rules. Each rule is expressed in the child's age in months:
Comments:
This clinic director obviously has good judgment regarding computer software and languages, to have insisted that the program be written in C++. In the process of designing the classes and class relationships for this program, it is important to keep in mind that the program will be converted to a graphical user interface in the future. Therefore, try to separate the user interface from the program implementation, to minimize the amount of rewriting that will have to be done later.
When designing the program, start with a few simple class names and list some of the attributes and operations that each will have. Possible class names might include Patient, Date, ImmunizationSchedule, Clinic, and Scheduler. What relationships, for example, will exist between Clinic and Patient? Or bewteen Clinic and Scheduler? Between Patient and Date? Between Patient and ImmunizationSchedule? Once you have these relationships mapped out clearly in your mind, it will be easier to complete the list of operations supported by each class.
© 1997, Kip Irvine.
* Any resemblance to a real clinic name is unintentional.