Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Use C++ 1. (100 points) Design a class named Employee. Design two child classes of Employee named Faculty and Staff. The UML diagram for the

Use C++ image text in transcribed
1. (100 points) Design a class named Employee. Design two child classes of Employee named Faculty and Staff. The UML diagram for the three classes is as follows (only their own members are listed for the Faculty and Staff classes. You should determine the access specifications needed to access any parent class members and methods. ITm office: String salary: int phoneNumber: String mail + Employee (name: String, phoncNumber String, email: String, office: String, salary int) + Employee (office: String, salary: int) +getOffice): String +setOffice(office: String): void getSalary O: String +setSalary(salary: int) void 0: void Facu Staff -department: String rank: String +Faculty(name: String, phoneNumber: -title: String +Staff(name: String, phoneNumber String, email: String, office: String String, email: String, office: String salary: int, department: String salary: int, title: String) +Stafftitle: String) rank: String) +Faculty(department: String, rank: String) +getDepartmentO: String +setDepartment(department: String): void +getRank0: String +setRank(rank: String): void +printInfo0: void : String +set Title(title: String): void +printinfo0: void Design a main function, which creates a Faculty object and a Staff object using one of their constructors and invokes their printInfo0 methods. 20 extra credit points will be added if your program can include the test part in main0 function to demonstrate dynamic biding and submit the corresponding screen shot. (Hint: you may declare the Employee::printlnfo0 function as virtual. Then the functions Faculty:printlnfo and Staff:printinfo become overridden functions

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

Principles Of Database Systems With Internet And Java Applications

Authors: Greg Riccardi

1st Edition

020161247X, 978-0201612479

More Books

Students also viewed these Databases questions