Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Please answer the question based the out put required and exactly the things question has asked. I have not seen correct answer to this question.

Please answer the question based the out put required and exactly the things question has asked.

I have not seen correct answer to this question. I was wondering if you write exact code according to question and output.

Design and implement the following classes: Class Person defines three data fields: name, address and phone number. Define all as string variables. Class Student inherits from class Person. Class Students defines one data field: status as string variable to hold one of the following values: Freshmen, Sophomore, Junior, or Senior. Class Employee inherits from class Person. Class Employee defines two data fields: salary of type double and date hired. Variable dateHired is an object of class Date. Class Visitor inherits from class Person. Class Visitor defines two data fields: visitPurpose of type string and visitDate of type Date. Variable visitPurpose holds a short description of the visit purpose such as to see Dr. Haddad, to meet with dept chair, to promote a new textbook, etc. Variable visitDate is an object of class Date. Class Faculty inherits from class Employee. Class Faculty defines two data fields: office number (as string, e.g., J-337) and rank as string to hold one of the following values: Assistant Professor, Associate Professor, or Full Professor. Class Staff inherits from class Employee. Class Staff defines one data field: title of type string to hold title value such as Advisor, Accountant, Painter, Manager, etc. In each class, override method toString() to print out the class name followed by the data fields of that class with proper and descriptive labels. Write a test program named testPerson to create at least one object of each class and call method toString() on that object. Organize your output so that it is easy to see how the inheritance relationship affects the characteristics of each object when printed out. Format the outputs following this sample run (values arte for illustration only). Person object: Name: John Smith Address: 1234 West Avenue, Kennesaw, GA 13431 Phone#: (770 456-1234 Student object: Name: Edward Myers Address: 5423 Northridge Street, Marietta, GA 1789 Phone#: (404) 123-5678 Status: Junior Employee object: Name: Mary Hendrick Address: 9873 East Street, Kennesaw, GA 30411 Phone#: (770) 555-5678 Salary: $98570 Date Hired: Sat Sep 21 02:00:12 EST 2018 Visitor object: Name: Andy White Address: 3456 E. Peachtree Drive, Atlanta, GA 30567 Phone#: (678) 234-1234 Visit: To see Dr. Haddad Visit Date: Mon Oct 23 04:45:45 EST 2018 Faculty object: Name: Jose King Address: 9987 Kennesaw Road, Atlanta, GA 78111 Phone#: (678) 120-0233 Salary: $90304 Date Hired: Tue JAN 10 07:30:02 EST 2014 Office#: KH-309 Rank: Associate Professor Staff object: Name: Amy Wise Address: 15621 Howard Avenue, Atlanta, GA 78632 Phone#: (770) 987-3003 Salary: $120890 Date Hired: Mon OCT 13 02:45:13 EST 2015 Title: Supervisor

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Database Marketing The Ultimate Marketing Tool

Authors: Edward L. Nash

1st Edition

0070460639, 978-0070460638

More Books

Students also viewed these Databases questions

Question

=+ What topics are contained in the contracts?

Answered: 1 week ago