class named person java code ????

Nov 9th, 2014
KateS
Category:
Programming
Price: $100 USD

Question description

Design a class named  Person and its two subclasses, Student and Employee. Make Faculty and Staff subclasses of Employee.

A Person
object  has a name , address, phone number, and email address (all Strings ).

A Student has a
class  status (freshman, sophomore, junior, or senior). Define the status as a final String  variable .

An Employee has an office number , salary (both
ints ), and a date hired. Use the MyDate class  defined below to create an object  for date hired:class  MyDate{private  String  date; //date in the form mm/dd/yy

public MyDate(
String  date){
this.date = date;
}

public
String  getDate(){
return date;
}
}

A Faculty
object  has office hours and a rank (both Strings ), while a Staff object  has a title (as a String ).

For the Student, Faculty, and Staff classes, create toString
methods  that store  information about the object  (in the format shown in the examples below).

Test your classes in a Driver
class  (within the same file) that asks the user what type  of object  they'd to create as well as what information they'd like it to have. The program  then uses the object 's toString method  to print information about that object .

SAMPLE RUN #1

--- Prompts For Keyboard/Console/Standard Input ---

Enter 1)To create a student 2)To create an employee:
Enter name :
Enter address:
Enter phone number:
Enter email:
Enter student's status:

Inputs

--- Keyboard/Console/Standard Input stdin ---

1
Walter D. Graham
4737 Stadium Drive Whitinsville, MA 01588
508-266-2108
walterdgraham@university.edu
Junior

Outputs 

--- Monitor/Console/Standard Output  ---

Enter
1)To create a student
2)To create an employee:Enter name :Enter address:Enter phone number:Enter email:Enter student's status:Student: Walter D. Graham
Status: Junior
Address: 4737 Stadium Drive Whitinsville, MA 01588
Phone Number: 508-266-2108
Email Address: walterdgraham@university.edu

What The Console Looks Like In An Interactive Session:

(Note: this combines standard input with standard output )

>java Driver
Enter
1)To create a student
2)To create an employee: 1
Enter name : Walter D. Graham
Enter address: 4737 Stadium Drive Whitinsville, MA 01588
Enter phone number: 508-266-2108
Enter email: walterdgraham@university.edu
Enter student's status: Junior
Student: Walter D. Graham
Status: Junior
Address: 4737 Stadium Drive Whitinsville, MA 01588
Phone Number: 508-266-2108
Email Address: walterdgraham@university.edu


SAMPLE RUN #2

--- Prompts For Keyboard/Console/Standard Input ---

Enter 1)To create a student 2)To create an employee:
Enter name :
Enter address:
Enter phone number:
Enter email:
Enter 1)To create a faculty member 2)To create a staff member:
Enter office number:
Enter salary:
Enter date hired (mm/dd/yy):
Enter office hours:
Enter rank:

Inputs

--- Keyboard/Console/Standard Input stdin ---

2
Kimberly D. Davis
795 University Hill Road Decatur, IL 62522
217-519-6747
kimdavis@school.edu
1
724
84101
06/12/92
5-7pm, Mon-Thu
Adjunct Professor

Outputs 

--- Monitor/Console/Standard Output  ---

Enter
1)To create a student
2)To create an employee:Enter name :Enter address:Enter phone number:Enter email:Enter
1)To create a faculty member
2)To create a staff member:Enter office number:Enter salary:Enter date hired (mm/dd/yy):Enter office hours:Enter rank:Faculty: Kimberly D. Davis
Rank: Adjunct Professor
Salary: $84101
Date Hired: 06/12/92

Office Hours: 5-7pm, Mon-Thu
Office: 724
Address: 795 University Hill Road Decatur, IL 62522
Phone Number: 217-519-6747
Email: kimdavis@school.edu

What The Console Looks Like In An Interactive Session:

(Note: this combines standard input with standard output )

>java Driver
Enter
1)To create a student
2)To create an employee: 2
Enter name : Kimberly D. Davis
Enter address: 795 University Hill Road Decatur, IL 62522
Enter phone number: 217-519-6747
Enter email: kimdavis@school.edu
Enter
1)To create a faculty member
2)To create a staff member: 1
Enter office number: 724
Enter salary: 84101
Enter date hired (mm/dd/yy): 06/12/92
Enter office hours: 5-7pm, Mon-Thu
Enter rank: Adjunct Professor
Faculty: Kimberly D. Davis
Rank: Adjunct Professor
Salary: $84101
Date Hired: 06/12/92

Office Hours: 5-7pm, Mon-Thu
Office: 724
Address: 795 University Hill Road Decatur, IL 62522
Phone Number: 217-519-6747
Email: kimdavis@school.edu


SAMPLE RUN #3

--- Prompts For Keyboard/Console/Standard Input ---

Enter 1)To create a student 2)To create an employee:
Enter name :
Enter address:
Enter phone number:
Enter email:
Enter 1)To create a faculty member 2)To create a staff member:
Enter office number:
Enter salary:
Enter date hired (mm/dd/yy):
Enter title:

Inputs

--- Keyboard/Console/Standard Input stdin ---

2
Jonathan A. Montgomery
4249 Camden Place Isle Of Palms, SC 29451
843-883-0082
jonnym@theschool.edu
2
206
53102
12/06/55
Chair of Physics Department

Outputs 

--- Monitor/Console/Standard Output  ---

Enter
1)To create a student
2)To create an employee:Enter name :Enter address:Enter phone number:Enter email:Enter
1)To create a faculty member
2)To create a staff member:Enter office number:Enter salary:Enter date hired (mm/dd/yy):Enter title:Staff: Jonathan A. Montgomery
Salary: $53102
Date Hired: 12/06/55

Office: 206
Address: 4249 Camden Place Isle Of Palms, SC 29451
Phone Number: 843-883-0082
Email: jonnym@theschool.edu

What The Console Looks Like In An Interactive Session:

(Note: this combines standard input with standard output )

>java Driver
Enter
1)To create a student
2)To create an employee: 2
Enter name : Jonathan A. Montgomery
Enter address: 4249 Camden Place Isle Of Palms, SC 29451
Enter phone number: 843-883-0082
Enter email: jonnym@theschool.edu
Enter
1)To create a faculty member
2)To create a staff member: 2
Enter office number: 206
Enter salary: 53102
Enter date hired (mm/dd/yy): 12/06/55
Enter title: Chair of Physics Department
Staff: Jonathan A. Montgomery
Salary: $53102
Date Hired: 12/06/55

Office: 206
Address: 4249 Camden Place Isle Of Palms, SC 29451
Phone Number: 843-883-0082
Email: jonnym@theschool.edu


SAMPLE RUN #4

--- Prompts For Keyboard/Console/Standard Input ---

Enter 1)To create a student 2)To create an employee:
Enter name :
Enter address:
Enter phone number:
Enter email:
Enter student's status:

Inputs

--- Keyboard/Console/Standard Input stdin ---

1
Rebecca M. Garrison
505 Freed Drive Stockton, CA 95202
209-768-3575
rgarrison@thisuniversity.edu
Sophomore

Outputs 

--- Monitor/Console/Standard Output  ---

Enter
1)To create a student
2)To create an employee:Enter name :Enter address:Enter phone number:Enter email:Enter student's status:Student: Rebecca M. Garrison
Status: Sophomore
Address: 505 Freed Drive Stockton, CA 95202
Phone Number: 209-768-3575
Email Address: rgarrison@thisuniversity.edu

What The Console Looks Like In An Interactive Session:

(Note: this combines standard input with standard output )

>java Driver
Enter
1)To create a student
2)To create an employee: 1
Enter name : Rebecca M. Garrison
Enter address: 505 Freed Drive Stockton, CA 95202
Enter phone number: 209-768-3575
Enter email: rgarrison@thisuniversity.edu
Enter student's status: Sophomore
Student: Rebecca M. Garrison
Status: Sophomore
Address: 505 Freed Drive Stockton, CA 95202
Phone Number: 209-768-3575
Email Address: rgarrison@thisuniversity.edu


SAMPLE RUN #5

--- Prompts For Keyboard/Console/Standard Input ---

Enter 1)To create a student 2)To create an employee:
Enter name :
Enter address:
Enter phone number:
Enter email:
Enter 1)To create a faculty member 2)To create a staff member:
Enter office number:
Enter salary:
Enter date hired (mm/dd/yy):
Enter office hours:
Enter rank:

Inputs

--- Keyboard/Console/Standard Input stdin ---

2
Sharon A. Singleton
4689 Wal Nuzum Farm Road Penfield, NY 14526
585-388-1198
sharsing@uni.edu
1
397
82134
04/21/45
8-9am Sat-Sun
Tenured Professor

Outputs 

--- Monitor/Console/Standard Output  ---

Enter
1)To create a student
2)To create an employee:Enter name :Enter address:Enter phone number:Enter email:Enter
1)To create a faculty member
2)To create a staff member:Enter office number:Enter salary:Enter date hired (mm/dd/yy):Enter office hours:Enter rank:Faculty: Sharon A. Singleton
Rank: Tenured Professor
Salary: $82134
Date Hired: 04/21/45

Office Hours: 8-9am Sat-Sun
Office: 397
Address: 4689 Wal Nuzum Farm Road Penfield, NY 14526
Phone Number: 585-388-1198
Email: sharsing@uni.edu

What The Console Looks Like In An Interactive Session:

(Note: this combines standard input with standard output )

>java Driver
Enter
1)To create a student
2)To create an employee: 2
Enter name : Sharon A. Singleton
Enter address: 4689 Wal Nuzum Farm Road Penfield, NY 14526
Enter phone number: 585-388-1198
Enter email: sharsing@uni.edu
Enter
1)To create a faculty member
2)To create a staff member: 1
Enter office number: 397
Enter salary: 82134
Enter date hired (mm/dd/yy): 04/21/45
Enter office hours: 8-9am Sat-Sun
Enter rank: Tenured Professor
Faculty: Sharon A. Singleton
Rank: Tenured Professor
Salary: $82134
Date Hired: 04/21/45

Office Hours: 8-9am Sat-Sun
Office: 397
Address: 4689 Wal Nuzum Farm Road Penfield, NY 14526
Phone Number: 585-388-1198
Email: sharsing@uni.edu


SAMPLE RUN #6

--- Prompts For Keyboard/Console/Standard Input ---

Enter 1)To create a student 2)To create an employee:
Enter name :
Enter address:
Enter phone number:
Enter email:
Enter 1)To create a faculty member 2)To create a staff member:
Enter office number:
Enter salary:
Enter date hired (mm/dd/yy):
Enter title:

Inputs

--- Keyboard/Console/Standard Input stdin ---

2
Cynthia P. Holt
401 Kenwood Place Pompano Beach, FL 3306
954-530-4906
cpholt@school.edu
2
162
51259
07/18/85
Dean of Faculty

Outputs 

--- Monitor/Console/Standard Output  ---

Enter
1)To create a student
2)To create an employee:Enter name :Enter address:Enter phone number:Enter email:Enter
1)To create a faculty member
2)To create a staff member:Enter office number:Enter salary:Enter date hired (mm/dd/yy):Enter title:Staff: Cynthia P. Holt
Salary: $51259
Date Hired: 07/18/85

Office: 162
Address: 401 Kenwood Place Pompano Beach, FL 3306
Phone Number: 954-530-4906
Email: cpholt@school.edu

What The Console Looks Like In An Interactive Session:

(Note: this combines standard input with standard output )

>java Driver
Enter
1)To create a student
2)To create an employee: 2
Enter name : Cynthia P. Holt
Enter address: 401 Kenwood Place Pompano Beach, FL 3306
Enter phone number: 954-530-4906
Enter email: cpholt@school.edu
Enter
1)To create a faculty member
2)To create a staff member: 2
Enter office number: 162
Enter salary: 51259
Enter date hired (mm/dd/yy): 07/18/85
Enter title: Dean of Faculty
Staff: Cynthia P. Holt
Salary: $51259
Date Hired: 07/18/85

Office: 162
Address: 401 Kenwood Place Pompano Beach, FL 3306
Phone Number: 954-530-4906
Email: cpholt@school.edu


Tutor Answer

(Top Tutor) Daniel C.
(997)
School: Duke University
PREMIUM TUTOR

Studypool has helped 1,244,100 students

8 Reviews


Summary
Quality
Communication
On Time
Value
Five Star Tutor
Dec 1st, 2016
" Outstanding Job!!!! "
SjSurvivor143
Nov 15th, 2016
" Thanks for the help. "
Joemoe
Nov 1st, 2016
" <3 it, thanks for saving me time. "
tinytim47
Oct 23rd, 2016
" Wow this is really good.... didn't expect it. Sweet!!!! "
pmallory
Oct 19th, 2016
" Totally impressed with results!! :-) "
mixedballz
Oct 10th, 2016
" excellent work as always thanks for the help "
kiln82
Sep 26th, 2016
" awesome work thanks "
darnay
Sep 17th, 2016
" The best tutor out there!!!! "
Ask your homework questions. Receive quality answers!

Type your question here (or upload an image)

1820 tutors are online

Brown University





1271 Tutors

California Institute of Technology




2131 Tutors

Carnegie Mellon University




982 Tutors

Columbia University





1256 Tutors

Dartmouth University





2113 Tutors

Emory University





2279 Tutors

Harvard University





599 Tutors

Massachusetts Institute of Technology



2319 Tutors

New York University





1645 Tutors

Notre Dam University





1911 Tutors

Oklahoma University





2122 Tutors

Pennsylvania State University





932 Tutors

Princeton University





1211 Tutors

Stanford University





983 Tutors

University of California





1282 Tutors

Oxford University





123 Tutors