Question: USING C++ 1) In this lecture we programmed a human class with variables name, height and weight. However in the lecture we only defined functions

USING C++

1) In this lecture we programmed a human class with variables name, height and weight. However in the lecture we only defined functions related to height. For this lab:

  • You should place prototypes of get and set functions for name and weight in the human.h, and define these functions in human.cpp.
  • In main, you should create the human object, set all variables up properly and then display the object's information using cout.

2)Create a class called employee that includes three instance variables

  • a rst name (type String)
  • a last name (type String)
  • a monthly salary (double)

Provide a set and a get method for each instance variable. If the monthly salary is not positive, set its value to 0. Write a main block that demonstrates class employees capabilities. Create two employee objects and display each objects yearly salary. Then give each employee a 10% raise and display each employees yearly salary again.

The files you need: employee.h, employee.cpp, main.cpp

employee.h should have variables and function prototypes. definitions should be placed in employee.cpp. main.cpp should have the main function.

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!