http://timlin.net/csm/cis254/Lab6.html
Can someone do this very quick.
If iI do not get it done I ill fail the semester.
I will donate $30 to anyone that finishes this soon.
Welcome to the Java Programming Forums
The professional, friendly Java community. 21,500 members and growing!
The Java Programming Forums are a community of Java programmers from all around the World. Our members have a wide range of skills and they all have one thing in common: A passion to learn and code Java. We invite beginner Java programmers right through to Java professionals to post here and share your knowledge. Become a part of the community, help others, expand your knowledge of Java and enjoy talking with like minded people. Registration is quick and best of all free. We look forward to meeting you.
>> REGISTER NOW TO START POSTING
Members have full access to the forums. Advertisements are removed for registered users.
http://timlin.net/csm/cis254/Lab6.html
Can someone do this very quick.
If iI do not get it done I ill fail the semester.
I will donate $30 to anyone that finishes this soon.
Hello javakid93,
This doesn't look like a quick job. How long do you have to complete it?
Do you already have the Person and/or Employee classes?
Please use [highlight=Java] code [/highlight] tags when posting your code.
Forum Tip: Add to peoples reputation by clicking the button on their useful posts.
That looks like homework Oh well... Add your own header comments
public class Student { private String address; private String city; private String state; private String zip; private String dateOfBirth; /** * Constructor * * @param address * @param city * @param state * @param zip * @param dateOfBirth * @throws NumberFormatException * Zip code is not a 5 digit number */ public Student (String address, String city, String state, String zip, String dateOfBirth) { setAddress(address); setCity(city); setState(state); setDateOfBirth(dateOfBirth); setZip(zip); } /** * @return the address */ public String getAddress () { return this.address; } /** * @param address * the address to set */ public void setAddress (String address) { this.address = address; } /** * @return the city */ public String getCity () { return this.city; } /** * @param city * the city to set */ public void setCity (String city) { this.city = city; } /** * @return the state */ public String getState () { return this.state; } /** * @param state * the state to set */ public void setState (String state) { this.state = state; } /** * @return the zip */ public String getZip () { return this.zip; } /** * @param zip * the zip to set * @throws numberFormatException * Zip code is not a 5 ditit number */ public void setZip (String zip) { // make sure valid zip is inputted if (zip.length() == 5) { Integer.parseInt(zip); this.zip = zip; } else { throw new NumberFormatException(); } } /** * @return the date Of Birth */ public String getDateOfBirth () { return this.dateOfBirth; } /** * @param dateOfBirth * the date Of Birth to set */ public void setDateOfBirth (String dateOfBirth) { this.dateOfBirth = dateOfBirth; } }public class Employee { private String address; private String city; private String state; private String zip; private String dateOfBirth; private double HourlyRate; private String title; private String startDate; /** * Constructor * * @param address * @param city * @param state * @param zip * @param dateOfBirth * @throws NumberFormatException * Zip code is not a 5 digit number */ public Employee (String address, String city, String state, String zip, String dateOfBirth, String title, String startDate, double hourlyRate) { setTitle(title); setHourlyRate(hourlyRate); setStartDate(startDate); setAddress(address); setCity(city); setState(state); setDateOfBirth(dateOfBirth); setZip(zip); } /** * @return the hourly rate */ public double getHourlyRate () { return this.HourlyRate; } /** * @param hourlyRate * the hourly Rate to set */ public void setHourlyRate (double hourlyRate) { this.HourlyRate = hourlyRate; } /** * @return the title */ public String getTitle () { return this.title; } /** * @param title * the title to set */ public void setTitle (String title) { this.title = title; } /** * @return the start Date */ public String getStartDate () { return this.startDate; } /** * @param startDate * the start Date to set */ public void setStartDate (String startDate) { this.startDate = startDate; } /** * @return the address */ public String getAddress () { return this.address; } /** * @param address * the address to set */ public void setAddress (String address) { this.address = address; } /** * @return the city */ public String getCity () { return this.city; } /** * @param city * the city to set */ public void setCity (String city) { this.city = city; } /** * @return the state */ public String getState () { return this.state; } /** * @param state * the state to set */ public void setState (String state) { this.state = state; } /** * @return the zip */ public String getZip () { return this.zip; } /** * @param zip * the zip to set * @throws numberFormatException * Zip code is not a 5 ditit number */ public void setZip (String zip) { // make sure valid zip is inputted if (zip.length() == 5) { Integer.parseInt(zip); this.zip = zip; } else { throw new NumberFormatException(); } } /** * @return the date Of Birth */ public String getDateOfBirth () { return this.dateOfBirth; } /** * @param dateOfBirth * the date Of Birth to set */ public void setDateOfBirth (String dateOfBirth) { this.dateOfBirth = dateOfBirth; } }
Hehe, thank goodness for Eclipse's generate getters and setters.
Last edited by helloworld922; July 26th, 2009 at 01:05 PM.
helloworld922 loves doing peoples homework
Nice work helloworld922. I hope you are going to claim the $30 reward!!
Please use [highlight=Java] code [/highlight] tags when posting your code.
Forum Tip: Add to peoples reputation by clicking the button on their useful posts.
I laughed when I saw this
Would you not just call the variable "dateOfBirth"? HAHAHAHAHAUse proper variable names, for example Data of birth should probably be called birthDate
// Json
Please use [highlight=Java] code [/highlight] tags when posting your code.
Forum Tip: Add to peoples reputation by clicking the button on their useful posts.
Haha, i don't think i even read that line
The whole thing was maybe 10 minutes, top. Enter all the fields that applied, use the generate getters/setters option, and wrote the constructor. Then i copied and pasted for the other classes (generating the extra getters/setters for the new fields)
I wish i made $180/hour everyday
Last edited by helloworld922; July 27th, 2009 at 11:07 AM.