Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Employee Exercise For this exercise, you will create two files the Employee.h file, which will hold the class and member function definitions, and the empDriver.cpp

Employee Exercise

For this exercise, you will create two files the Employee.h file, which will hold the class and member function definitions, and the empDriver.cpp file, which will be used to implement the Employee objects.

Employee.h

Create a class called Employee that includes the following:

1. Two data members:

- full name

- monthly salary

2.Two constructor that initializes the two data members.

- The first constructor should be a default constructor. It takes no parameters but initializes the name and salary to (space) and 0 respectively.

- The second constructor should take two parameters and should initialize the name and salary using the values in the parameters

3. Accessor and Mutator functions for each member.

Tip: create inline functions for this exercise.

empDriver.cpp

Create a driver program that tests the Employee class.

1. Create two Employee objects. (You may hard code one object to test your 2-paramter constructor. The other object should rely on your default constructor)

2. Prompt the user for input for the object that was not hardcoded. Transfer the values to the private class members by using the mutator functions.

3. Use the accessor functions to retrieve the name and salaries for the employees and calculate the yearly salary. Display the name and yearly salary for the objects.

4. Give your employees a 10% raise! Use the mutator functions to update the value of their monthly salary.

5. Repeat step 3 to show that the raisehas taken effect.

Sample output is shown below:

Enter an employee name: Peter Peterson

Enter the employee's monthly salary: 4000

Here are the employees and their yearly salaries

Nicole Watterson: $42000

Peter Peterson: $48000

Here are the employees and their yearly salaries with a 10% raise

Nicole Watterson: $46200

Peter Peterson: $52800

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

Data Management Databases And Organizations

Authors: Watson Watson

5th Edition

0471715360, 978-0471715368

More Books

Students also viewed these Databases questions

Question

What is Change Control and how does it operate?

Answered: 1 week ago

Question

How do Data Requirements relate to Functional Requirements?

Answered: 1 week ago