Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

on c++ microsoft visual studio Scenario/Summary We have two separate goals this week: We are going to create an abstract Employee class and two pure

on c++ microsoft visual studio

Scenario/Summary

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 Lab.

Software Citation Requirements

This course uses open-source software, which must be cited when used for any student work. Citation requirements are on the Open Source Applications page. Please review the installation instruction files to complete your assignment.

Deliverables

Due this week:

Capture the Console output window and paste it into a Word document.

Zip the project folder in the Microsoft Visual Studio.

Upload the zip file and screenshots (word document).

Required Software

Connect to the Lab here. (Links to an external site.)Links to an external site.

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.

image text in transcribed

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

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.

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:

image text in transcribed

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: image text in transcribed

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

Partial Sample Output: image text in transcribed

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.

image text in transcribed

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_2

Step: 3

blur-text-image_3

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

Moving Objects Databases

Authors: Ralf Hartmut Güting, Markus Schneider

1st Edition

0120887991, 978-0120887996

More Books

Students also viewed these Databases questions

Question

2. What abilities are possible because humans use symbols?

Answered: 1 week ago