Need Help With C Please Your Program Must Include The Following As Comments At The B 2748450

Need help with C++ please.

Your program must include the following as comments at the beginning of the program:


student number

assignment information

program documentation

This assignment will give you practice defining and using a class in a program.

Create a class named Employee that includes the following:

3 private data members:

first name      (type string)

last name       (type string)

monthly salary      (type double)

The class should have one constructor with 3 default parameters. The constructor initializes the three data members when an object is created. The default value for first name and last name is “unknown”. The default value for the monthly salary is 0.00.

You must validate the data member monthly salary. If the value provided for monthly salary is not positive (greater than zero) set the value to 0.00. Do your validation in the setMonthlySalary() function. Your constructor should call the setMonthlySalary function to validate monthly salary.

Provide get and set member functions for the 3 data members (for example:  getFirstName(), setLastName(), getMonthlySalary(), etc. )

Provide a member function to display the state of an employee object. Call this function displayEmployee(). The displayEmployee() function should not directly access the data members. Instead, it should use the get member functions to retrieve these values.

The output from function displayEmployee() functiion should be formatted as shown below: (without the bullet points… )

First name      : <first name>

Last name       : <last name>

Monthly Salary : <real number displayed with 2 decimal digits>

All of the member functions should have public access.

The class declaration must be stored in the header file employee.h

The definition of the class member functions must be in the file employee.cpp

Create a test program ( assign03.cpp ) that demonstrates class Employee’s capabilities. Your program should demonstrate objects being created. Objects being modified using the set methods. Information displayed using get member functions and also the displayEmployee() member function. For one of your objects, try changing the monthly salary to a negative number and then display the value of the monthly salary to show the validation worked correctly.

When you have completed the assignment, create a ZIP file that includes the following:

Employee class declaration (employee.h)

Employee class source file (employee.cpp)

Your program source file (assign_03.cpp)

Thank you,

Prof. Angela


Calculate Price

Price (USD)
Open chat