//Given that A person has a name,email address, phone number, and
address. String name; String email; String phone; String address; Public : void display(); void getter() { cin>>name>>email>>phone>>address; } void setter() { set value after modifying data if any or as per requirement } Person() // they can be used to assign a default value { getter(); } }
//write same definitions for all function for below extended function
class Student extends Person{
//A student has a class status string string status; Public : void display(); void getter(); void setter(); student(); }
class Employee extends Person{
//Given that An employee has an office, salary, and date hired. String office; double salary; char dateHired[8]; date in format DDMMYYYY Public : void display(); void getter(); void setter(); Employee(); } class Faculty extends Employee{ //Given that A faculty member has office hours and a rank. double officeHours;//office hours in decimal e.g. 5.5 hours of work schedule long rank; Public : void display(); void getter(); void setter(); Faculty(); }
class Staff extends Employee{
String title; //It's mentioned that A staff member has a title Public : void display(); void getter(); void setter(); staff(); }