C++ please! Please type it and no pictures. Create a class called Employee that includes three data members: a first name (type string), a last name (type string), and monthly salary (type int). The class will have a constructor that initializes the three data members. Include the set and get member functions for each data member. If the monthly salary is not positive, the set function will set it to 0. Also include a member function that returns the yearly salary (i.e. twelve times the monthly salary). Write a test program that prompts the user to enter the first and last name of an employee as well as their monthly salary. The program will then output the yearly salary of the employee, give them a 10 percent raise, and output the yearly salary again.
C++ please! Please type it and no pictures.
Create a class called Employee that includes three data members: a first
name (type string), a last name (type string), and monthly salary (type int).
The class will have a constructor that initializes the three data members.
Include the set and get member functions for each data member. If the monthly
salary is not positive, the set function will set it to 0. Also include a
member function that returns the yearly salary (i.e. twelve times the monthly
salary).
Write a test program that prompts the user to enter the first and last
name of an employee as well as their monthly salary. The program will then
output the yearly salary of the employee, give them a 10 percent raise, and
output the yearly salary again.
Trending now
This is a popular solution!
Step by step
Solved in 3 steps with 1 images