Understand the UML Diagram

profilezod4d8s
understand_the_uml_diagram.docx

Lab Steps

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.

https://lms.courselearn.net/lms/CourseExport/files/b49022c6-54f9-4726-b9d2-2c1fc26cb9b5/images--cis247c_w6_ilab_01.gif

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

1. Define calculatePay() as a pure virtual function.

2. Define displayEmployee() as a pure virtual function.

3. When class Employee contains two pure virtual functions, it becomes an abstract class.

STEP 4: Create Generalized Input Methods

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

STEP 5: Modify the Main Method

Create two employee pointers with:

https://lms.courselearn.net/lms/CourseExport/files/b49022c6-54f9-4726-b9d2-2c1fc26cb9b5/images--cis247c_w6_ilab_02.gif

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: https://lms.courselearn.net/lms/CourseExport/files/b49022c6-54f9-4726-b9d2-2c1fc26cb9b5/images--cis247c_w6_ilab_03.gif

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

Partial Sample Output: https://lms.courselearn.net/lms/CourseExport/files/b49022c6-54f9-4726-b9d2-2c1fc26cb9b5/images--cis247c_w6_ilab_04.gif

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.

https://lms.courselearn.net/lms/CourseExport/files/b49022c6-54f9-4726-b9d2-2c1fc26cb9b5/images--cis247c_w6_ilab_05.gif