CSc 330 – Object-Oriented Design & Programming in C++
Professor Domanski - Telephone Directory
Download
the datafile (dir.txt)
Download/Open a non-GUI demo
Download/Open
the datafile for the GUI
Download/Open a GUI demo
Design and implement a C++
class
to model a telephone directory for a company. The directory should contain space for up to
100 names, phone numbers, birthday, and room numbers (where the first digit of
the room number is the floor). You
should have functions to do the
following:
- Create an empty directory (all names bl
- Read in all the telephone directory
information from a file – create &
read can be done within a constructor.
- Retrieve the entry corresponding to a given
last name or first name
- Display the entire directory
- Add a new entry to the directory
- Display the entries with the same birth month
- Display the names of all people whose offices
are on the same floor (assume the first digit of the room number indicates
the floor).
Input
Each line of the input file
(called “dir.txt” which should be in the same directory as the
running program) is in the following format:
- Last name 15
char string
- First name 10
char string
- Middle Initial 1 char
- Phone No. 10.
char string
- Room No. 3
digit char string
- Date of Birth 3
char strings: mm dd yyyy eg. 4 12 1959
or 12 9 2004
For example:
JOHNSON JAMES L 4103332222 315 1
31 1975
Create a simple GUI
that will allow the user to
- Choose options to perform (see below)
- Enter data about new entries
- Display data about existing entries
- Display results of specialized searches
You should allow the user to
pick from the following options:
- Find an entry corresponding to a given last
name or first name
- Display all the telephone directory
information
- Add a new entry to the directory
- Display the names of all the people with the
same birth month
- Display the names of all the people with the
offices on the same floor
Notes
- You must use classes.
- You may want to use structures within
classes, or classes within classes (ie. Friend classes)
- All submissions are expected to be individual
work. All work handed in
must be original. Duplicate or very similar programs receive
no points.
Time for Completion: : 3
weeks
Last Updated: April 10, 2006