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.
Printable View
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?
That looks like homework :( Oh well... Add your own header comments :P
Code :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; } }
Code :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.
helloworld922 loves doing peoples homework ;)
Nice work helloworld922. I hope you are going to claim the $30 reward!!
I laughed when I saw this :D
Would you not just call the variable "dateOfBirth"? HAHAHAHAHA :DQuote:
Use proper variable names, for example Data of birth should probably be called birthDate
// Json
Haha, i don't think i even read that line :D
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) :D
I wish i made $180/hour everyday