Ermac1978 / Assignments

The Iron Yard Assignments
0 stars 0 forks source link

Assignment 21 #23

Closed Ermac1978 closed 10 years ago

Ermac1978 commented 10 years ago

Assignment 21

First

Create a Person class with attributes: first name, last name, and birthdate.

First name and last name should not be able to be written to, but should be readable.

Birthdate can be set and read.

Create a public instance method called 'name' that takes the name and sets the first name and last name instance variables.

Create a public instance method to get the user's age.

Ask the user their name as one question, but store it separately in first and last name variables.

As you ask the user their information, create the Person object.

After asking each user their information, output the user's age.

Next

Move the functionality in your age method into a private method called, "calculateAge". This method will be called from the public age method.

Create a class variable that will count the number of users that enter in their information. After you output the user's age, also output the number of user they are so far (using the class variable).

Loop to allow another user to enter their information. (exit when user enters \q for name). Create a User object for each user.

brianburridge commented 10 years ago

:+1: