Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

In this lab assignment, students will demonstrate the ability to: Understand the basic concepts and syntax of object-oriented programming in C++. Define Employee class. Create

In this lab assignment, students will demonstrate the ability to:

Understand the basic concepts and syntax of object-oriented programming in C++.

Define Employee class.

Create Employee objects and use the objects to perform object-oriented programming.

COURSE PREPARATION

Read the following documents:

Chapter 10 lecture slides and e-textbook.

Chapter 10 Program Examples.

GRADING RUBRIC

Indent code and insert comments to document your program. [10 pts]

Define Employee header files Employee.h. [20 pts]

Implement Employee class in Employee.cpp file. [30 pts]

Implement object-oriented programming in TestProgram.cpp file. [30 pts]

Compress the whole project folder in a zip file, submit the zip file to BB for credits. [10 pts]

PROBLEM and INSTRUCTIONS

In this lab assignment, you will develop a C++ program to create Employee object using the data in the attached employees.txt file. Then use the employee objects to perform object-oriented programming tasks:

Input data file employees.txt with each employees last name, first name, job title and salary ----

Sample Output on screen ----

Alfalfa Aloysius Accountant 43400.00

Alfred Francis Secretary 29000.00

Gerty Gramma Sales 64000.00

Android Alexis Programmer 84000.00

Bumpkin Fred Programmer 79000.00

Rubble Betty Sales 60000.00

Noshow Cecil Accountant 46253.00

Buff Bif Researcher 65000.00

Airpump Andrew Technician 56780.00

Backus Jim Manager 89560.00

The average salary of all employees is: 61699.30

All employees will have 5% salary increase:

Alfalfa Aloysius Accountant 45570.00

Alfred Francis Secretary 30450.00

Gerty Gramma Sales 67200.00

Android Alexis Programmer 88200.00

Bumpkin Fred Programmer 82950.00

Rubble Betty Sales 63000.00

Noshow Cecil Accountant 48565.65

Buff Bif Researcher 68250.00

Airpump Andrew Technician 59619.00

Backus Jim Manager 94038.00

The new average salary of all employees is: 64784.26

Create a new C++ project YourLastname_Lab1, define class Employee and tester program by adding the following files:

Employee.h (Header Files folder)

Employee.cpp (Source Files folder)

TestProgram.cpp (Source Files folder)

Declare the following data members and member function prototypes of class Employee in Employee.h:

Data members

First name (string)

Last name (string)

Job title (string)

Salary (double)

Member functions

Constructor without parameter.

Constructor with parameters.

Getter and setter function for each non-static data member.

Void function which displays an employees last name, first name, job title and salary.

Define the member functions of class Employee in Employee.cpp:

Constructor without parameter.

Constructor with parameters.

Getter and setter function for each non-static data member.

Void function to display employees last name, first name, job title and salary.

Define tester (driver) program to perform object-oriented programming in main () function of TestProgram.cpp:

Create employee object by reading the employee record data from the attached data file employees.txt.

Put the employee objects in an Employee object array.

Iterate the employee object array to display the employee record by calling the employee objects member function.

Calculate and display the average salary of all employee objects.

Each employee will receive 5% salary increase. Iterate the employee object array to calculate and display each employees record with new salary by calling the employee objects member function.

Calculate and display the increased average salary of all employees.

Note

No global non-constant variables should be used.

You can add more data members or member functions for Employee class if needed.

There should be NO stand-alone function, all functions should be member functions of class Employee.

Submission

Compress the whole project folder in a zip file, submit the zip file to BB for credits.

The project should include the following files:

Employee.h

Employee.cpp

TestProgram.cpp

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

Databases Demystified

Authors: Andrew Oppel

1st Edition

0072253649, 9780072253641

More Books

Students also viewed these Databases questions

Question

=+Trainers from headquarters? Local trainers? Independent trainers?

Answered: 1 week ago