Project 4
Administrative Details
Due Date: Friday, November 17, 2006 at 11:59pm
Points: 30 points possible. 25% of the points taken off each day late.
Project Description
Your assignment is to create two classes: Wage class and Salary class. Each of the classes will inherit from your Person class.
Details:
- If you do not trust that your Person class was 100% correct, you can start off with my version. You can download my "Person.java" from here.
- If you do not trust that your Birthday class was 100% correct, you can start off with my version. You can download my "Birthday.java" from here.
Wage class
- Your Wage class should have the following:
- A data field (an int) that indicates how many days a week the Wage person works.
- A data field (an int) that indicates how many hours a day the Wage person works.
- A "setHoursPerDay" method that does not return anything and takes an int.
- A "setDaysPerWeeks" method that does not return anything and takes an int.
- A "getHoursPerDay" method that returns the hours worked per day (an int).
- A "getDaysPerWeeks" method that returns the days worked per week (an int).
- Create a "getPayCheck" method that calculates how much a Wage person would receive per every a 2 week period (an int): hours_worked_per_day * days_worked_per_week * salary * 2.
- Create one constructor that have the following signature: Wage(String fullName, int salary, int days_per_week, int hours_per_day)
Salary class
- Your Salary class should have the following:
- Create a "getPayCheck" method that returns the salary (int) of the Salary person in terms of a 2 week paycheck. To do this take the yearly salary and divide it by 26: salary / 26.
- Create one constructors that have the following signature: Salary(String fullName, int salary)
Change the Person class
- Create a "getPayCheck" method that returns an int of the value of "-1".
How to submit
Web-Cat is not ready for submissions yet.
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
- Zip your files (Employees, Person, and Birthday java files) together. To do this highlight both of java files in Windows Explorer (note this in not Internet Explorer - this is the file viewer) and right click on one of the files. Select the menu "Send To" and then select "Compressed (zipped) Folder". This will created a new file that ends in ".zip". It will be named either "Person.zip" "Employees.zip" or "Birthday.zip".
- 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 ".zip" file (whereever on your local machine the file is) to upload it. Select your ".zip" file (e.g. "Employees.zip"). Click "Open."
- Click "Next."
- If your file uploaded and the correct files are shown (e.g. Person.java, Birthday.java, and Employees.java) correctly click "Next."
- Wait for the automatic grader to grade your project to see your score.
If you find typoes or the wording is unclear please email me. -- Dr. Ball