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

 Main Method: static void Main(string[] args) { Employee[] emps = {

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:

new Employee( "Robert", "John", 6611 ), new Faculty("Sara", "Brown", 2010, "CSC"), new

Expected Output:

Instructor("Steven", "Hank", 3344, "ECE", 20) }; foreach (Employee e in emps) e.Print();

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

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!