Academic Integrity: tutoring, explanations, and feedback — we don’t complete graded work or submit on a student’s behalf.

We have two separate goals this week: Due this week: STEP 1: Understand the UML

ID: 3540804 • Letter: W

Question

We have two separate goals this week:

Due this week:

STEP 1: Understand the UML Diagram

Notice in the updated UML diagram that the Employee class is designated as abstract by having the class name Employee italicized. Also, the calculatePay method is italicized, which means that it is a pure virtual function and needs to be implemented in the derived classes. In addition, make displayEmployee() method a pure virtual function as well.

STEP 2: Create the Project

Create a new project and name it CIS247C_WK6_Lab_LASTNAME. Copy all the source files from the Week 5 project into the Week 6 project.

Before you move on to the next step, build and execute the Week 6 project.

STEP 3: Modify the Employee Class

STEP 4: Create Generalized Input Methods

Reuse method getInput() from the previous iLab to prompt the user to enter Employee information.

STEP 5: Modify the Main Method

Create two employee pointers with:

The first employee pointer refers to a salaried employee and the second employee pointer refers to a hourly employee.

Prompt the user to enter information for these two pointers and display the calculated result.

For salaried employee, the following information needs to be displayed:

Partial Sample Output:

For hourly employee, the following information needs to be displayed:

Partial Sample Output:

STEP 6: Compile and Test

When done, compile and run your code.

Then, debug any errors until your code is error-free.

Check your output to ensure that you have the desired output, modify your code as necessary, and rebuild.

Below is a complete sample program output for your reference.

STEP 7: Submit Deliverables

See Syllabus "Due Dates for Assignments & Exams" for due date information.


                

Deliverables We have two separate goals this week: We are going to create an abstract Employee class and two pure virtual functions - calculatePay() and displayEmployee(). The abstract Employee class will prevent a programmer from creating an object based on Employee, however, a pointer can still be created. Objects based on Salaried and Hourly will be allowed. The pure virtual function calculatePay() in Employee will force the child classes to implement calculatePay(). The other pure virtual function displayEmployee() in Employee will force the child classes to implement displayEmployee(). We are going to implement Polymorphism and dynamic binding in this iLab. Capture the Console output window and paste it into a Word document. Zip the project folder in the Microsoft Visual Studio. Put the zip file and screenshots (word document) in the Dropbox. Notice in the updated UML diagram that the Employee class is designated as abstract by having the class name Employee italicized. Also, the calculatePay method is italicized, which means that it is a pure virtual function and needs to be implemented in the derived classes. In addition, make displayEmployee() method a pure virtual function as well. Create a new project and name it CIS247C_WK6_Lab_LASTNAME. Copy all the source files from the Week 5 project into the Week 6 project. Before you move on to the next step, build and execute the Week 6 project. Define calculatePay() as a pure virtual function. Define displayEmployee() as a pure virtual function. When class Employee contains two pure virtual functions, it becomes an abstract class. Reuse method getInput() from the previous iLab to prompt the user to enter Employee information. Create two employee pointers with: The first employee pointer refers to a salaried employee and the second employee pointer refers to a hourly employee. Prompt the user to enter information for these two pointers and display the calculated result. For salaried employee, the following information needs to be displayed: For hourly employee, the following information needs to be displayed: When done, compile and run your code. Then, debug any errors until your code is error-free. Check your output to ensure that you have the desired output, modify your code as necessary, and rebuild. Below is a complete sample program output for your reference. Submit your lab to the Dropbox located on the silver tab at the top of this page. For instructions on how to use the Dropbox, read these Step-by-Step Instructions or watch this Tutorial Dropbox Tutorial. See Syllabus "Due Dates for Assignments & Exams" for due date information.

Explanation / Answer

Dear,

// Program.cs (main program)

class Program
    {
        static void Main(string[] args)
        {
            Console.WriteLine(" This program tests an Employee inheritance hierarchy ");           
            // arrsy to hold Employee type objects
            Employee []employeeList = new Employee[2];           
            // Salaried Employee
            employeeList[0] = new Salaried();
            // Hourly Employee
            employeeList[1] = new Hourly();

            // Collecting employees information
            Utilities.CollectEmployeeInformation(employeeList[0]);
            Utilities.CollectEmployeeInformation(employeeList[1]);

            // Displaying employees information
            Utilities.DisplayEmployeeInformation(employeeList[0]);
            Utilities.DisplayEmployeeInformation(employeeList[1]);
          
            //displaying number of emps
            Console.WriteLine(" Total number of Employees in Database : {0} ", Employee.GetNumberOfEmployees());
            Console.WriteLine(" Thank you for using the Abstract Employee Inheritance Hierarchy ");
        }
    }

I hope this will helps you...

Hire Me For All Your Tutoring Needs
Integrity-first tutoring: clear explanations, guidance, and feedback.
Drop an Email at
drjack9650@gmail.com
Chat Now And Get Quote