Object based program

I am a database programmer by background. As part of my college program, I am studying c++. For some reason, I am not getting it. No matter how many books I read I can't wrap my head around it. My professor is Italian and speaks EH English. Below is our next assignment due on 4/25. I am not asking anyone to do the assignment FOR me. I would like to start a discussion so that I can begin to work through my issues. This looks like I need to create a fairly DEEP array to store all of the information... In my DB mind, I want to make a table. I find myself reaching out for Visual Basic concepts that I know are too immature for this language. Talk to me?

Create a program that is based on objects.
The main functions should include storing and retrieving information about people.
Part 1
Create an object of type Person. The data attributes should be private.
Each attribute should have a setter and a getter.
The attributes include: first name, last name, date of birth, email address, phone number.
Part 2
Create an event-driven program that contains the following options:
Create a record (initializes a new object and add it to the list of contacts in the array)
Add/Modify first name
Add/Modify last name
Add/Modify phone number
Add/Modify email address
Add/Modify date of birth
Print record
Exit
If the user chooses to add any information or to print the record before the person has been created the
system should notify the user about the fact that a record does not exist yet.
Part 3
If a person's information is already set you should ask the user if they want to overwrite the old data.
Part 4
When you print the person's record you should display the information in the following manner:
Judy Miller (01/01/01)
410-555-1234
jmiller@towson.edu
If any information is not available let the user know by printing dashes in place of the missing data.
I don't know what C++ you're learned already, or the aim of your course. But when I read the specification I think of an array of objects (well, I'd code it with STL, either using a vector or a map)

I take it that you're already covered classes, new and delete, loops, iostream, etc. Have you also dealt with the STL?

I would express part one differently. In C++ terms, you want to declare a class. Then you can create an object (or objects).

As far as even driven goes, are you talking about a console app with a while loop, or a fully fledged GUI program?

Andy
Last edited on
Topic archived. No new replies allowed.