Project 2
Administrative Details
Due Date: Friday, September 29, 2006 at 11:59pm
Points: 40 points possible. 10 points taken off each day late.
Project Description
Your assignment is to create a "Birthday" class.
Details:
- This Birthday class must be named "Birthday" - note the capital "B." If your class is titled "birthday" the automatic grader will give you a zero for the project.
- Your Birthday class must have the following constructors:
- A constructor that takes no arguments. The constructor should default to an birthday of 1-1-2001.
- A constructor that takes three arguments in this exact order: int day, int month, int year.
- Your Birthday class must have the following methods:
- A "setDay" method that takes a single argument: an int. This method replaces the day of the birthday.
- A "setMonth" method that takes a single argument: an int. This method replaces the month of the birthday.
- A "setYear" method that takes a single argument: an int. This method replaces the year of the birthday.
- A "getDay" method that takes no arguments and returns an it. This method returns the day of the birthday.
- A "getMonth" method that takes no arguments and returns an it. This method returns the month of the birthday.
- A "getYear" method that takes no arguments and returns an it. This method returns the year of the birthday.
- A "getAge" method that takes no arguments and return an int. This method returns the age based today's date. Today's date can be obtained by the provided method's "getThisMonth," "getThisDay," and "getThisYear."
- A "isSeniorCitizen" method that takes no arguments and returns a boolean. This method returns true if the age is 65 years old or greater as of today. today
- Your Birthday class must have the following data fields:
- An int that holds the day of the birthday.
- An int that holds the month of the birthday. For example, if "month" were equal to 9, then that would indicate September. 1 = January, 2 = February, 3 = March, etc.
- An int that holds the year of the birthday.
- You do not have to test for valid months or days. For example, you do not need to test to see if a month of "13" is passed or not. Nor do you have to worry about the 35th day of March. For this project you can assume that all input will be valid.
- You will start this project with a base code that provides the private method that you will need to obtain today's date. You can obtain the base code here.
How to submit
You may submit as many times as you want. There are two ways to submit this project:
- Submit through BlueJ. The lab machines are configured to automatically submit to Web-Cat - the automatic grader. To do so perform the following steps:
- Open BlueJ on one of the lab machines.
- Open your project. You should see your "Person" class displayed as a rectangle.
- Before submitting make sure that your class compiles.
- To submit: Click on the "Tools" menu. Under "Tools" click on "Submit...". Choose CS 1054 and Project 1.
- Submit manually through the Web-Cat website
- Go to http://web-cat.cs.vt.edu/Web-CAT/WebObjects/Web-CAT.woa.
- Log in using your user name and password that you use for Webmail and Hokie Spa.
- Click on the "Submit" tab. It can be located at the top left of the webpage.
- Select CS 1054 (the CRN may be wrong) then click "Next".
- Select "Project 1" then click "Next".
- Click the "Browse..." button. Browse to your "Person.java" file (whereever on your local machine the file is) to upload it. Select your "Person.java" file. Click "Open."
- Click "Next."
- If your file uploaded correctly click "Next."
- Wait for the automatic grader to grade your project to see your score.