Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Program#2(30points): Design and implement the following classes: Class Person that defines three data fields: name, address and phone number. Class Student that inherits from class

image text in transcribed
image text in transcribed
Program#2(30points): Design and implement the following classes: Class Person that defines three data fields: name, address and phone number. Class Student that inherits from class Person. Class Students defines one data field: status as string variable (Freshmen, Sophomore, Junior, Senior) Class Employee that inherits from class Person. Class Employee defines two data fields: salary and date hired (dateHired is an object of class Date) Class Faculty that inherits from class Employee. Class Faculty defines two data fields: office number (as string, e.g., J-337) and rank (Assistant Professor, Associate Professor, Full Professor) Class Staff that inherits from class Employee. Class Staff defines one data field: title (e.g., Advisor, Accountant, Painter, Manager, etc.) In each class, override method toString() to print out the class name and the data fields of that class with proper 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. Output would be similar to the following sample run

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

Databases And Information Systems 1 International Baltic Conference Dbandis 2020 Tallinn Estonia June 19 2020 Proceedings

Authors: Tarmo Robal ,Hele-Mai Haav ,Jaan Penjam ,Raimundas Matulevicius

1st Edition

303057671X, 978-3030576714

More Books

Students also viewed these Databases questions