CMPSCHWK2 - r eate a Person class to represent a person's...

Info iconThis preview shows pages 1–2. Sign up to view the full content.

View Full Document Right Arrow Icon
reate a Person class to represent a person's contact information. Your Person class must consist of the following: PRIVATE members: string firstName,lastName; birthDate //you get to choose the data type, but the type you choose must be able to maintain a // 1 day resolution PUBLIC members: 1. Default constructor that sets the first name to "", last name to "", and the date of birth to January 1st, 2000. 2. Copy constructor 3. Initialization constructor that takes 3 arguments - 1 const string for each first name and last name, and a third argument of the type you use for your Person's age. 4. Three Accessor methods that each return one of the private data members - the first name, last name, and date of birth as strings (i.e. string type). In other words, you must implement these methods: string getFirstName() const; string getLastName() const; string getBirthDate() const; 5. A method that compares the age of this person with another person's age, returning the number of days old this person is to the others. This method must have the following
Background image of page 1

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon
Image of page 2
This is the end of the preview. Sign up to access the rest of the document.

This note was uploaded on 01/23/2011 for the course CMPSC 122 at Pennsylvania State University, University Park.

Page1 / 2

CMPSCHWK2 - r eate a Person class to represent a person's...

This preview shows document pages 1 - 2. Sign up to view the full document.

View Full Document Right Arrow Icon
Ask a homework question - tutors are online