Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Main Method: static void Main(string[] args) { Employee[] emps = { new Employee( Robert, John, 6611 ), new Faculty(Sara, Brown, 2010, CSC), new Instructor(Steven, Hank,

image text in transcribed

Main Method:

static void Main(string[] args)

{

Employee[] emps = {

new Employee( "Robert", "John", 6611 ),

new Faculty("Sara", "Brown", 2010, "CSC"),

new Instructor("Steven", "Hank", 3344, "ECE", 20)

};

foreach (Employee e in emps)

e.Print();

Console.WriteLine("-----------------------------------------");

emps[0].EmployeeNumber = 331;

Console.WriteLine(emps[0].EmployeeName + ": " + emps[0].EmployeeID);

}

Class Diagram:

image text in transcribed

Expected Output:

image text in transcribed

1- Create 3 classes Employee, Faculty, and Instructor as shown in the class diagram below. 2- Faculty should inherit Employee and Instructor should inherit Faculty. 3- Apply the concept of least privilege. All your data members must be private. 4- Do not define any new data members in any class. However, you are allowed to define private methods. 5- Implement whatever accessors (set/get) necessary. 6- Note that the Employee Number is a 4-digit number, the ID is dynamically constructed as 7- Method Print in Faculty and Instructor should override the one in their parent (base) class. 8- Implement the constructors of all classes. 9. Use the Main method provided below. 10- The output of your program, given the Main method below, should look exactly as shown in the output box. Employee Faculty -firstName: string -lastName: string -Number: int -ID: string -Code: string +Print() : void +Print() : void Instructor -Rate: decimal +Print() : void ll Employee name: Robert John Employee ID: rjoh6611 Employee name: Sara Brown Employee ID: sbro 2010 Department Code: CSC Employee name: Steven Hank Employee ID: shan3344 Department Code: ECE Rate:20 $/hour Cannot Change Number. The Employee Number should be exactly 4 digits. Robert John: rjoh6611

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

Statistical And Scientific Database Management International Working Conference Ssdbm Rome Italy June 21 23 1988 Proceedings Lncs 339

Authors: Maurizio Rafanelli ,John C. Klensin ,Per Svensson

1st Edition

354050575X, 978-3540505754

More Books

Students also viewed these Databases questions