Question: . . . Q5: Create a class called Employee that includes three pieces of information as private data members A first name (type string). A

 . . . Q5: Create a class called Employee that includes
three pieces of information as private data members A first name (type

. . . Q5: Create a class called Employee that includes three pieces of information as private data members A first name (type string). A last name (type string). A monthly salary (type double). Your class should have a constructor that initializes the three data members. If the monthly salary is not positive, set it to 0. Write a test program that demonstrates class Employee's capabilities. Create two Employee objects and display each object's yearly salary. Then give each Employee a 10 percent raise and display each Employee's yearly salary again. Q6: Create a class called Date that includes three pieces of information as data members: A month (type int) A day (type int) A year (type int) Your class should have a constructor with three parameters that uses the parameters to initialize the three data members. Provide a member function displayDate that displays the month day and year separated by forward slashes (). Write a test program that demonstrates class Date's capabilities. . . . Q7: Consider a class emp, which is defined as shown: class emp int id; float salary: public: emp() (id =0; salary = -1;) void input (int c, float s) id=c; salary 9: ????? 1) Define in main function an array allemp of 50 object of type emp. 2) Using a loop, in the main function write a code to change id and salary of the first 10 objects of the array to the values 100 and 500 respectively, 3) Replace the????? in the class definition with a member function which prints the id and salary of the objects. 4) Using a loop, in the main function write a code to print id and salary of the first 5 objects of the array 5) Implement the access specifier protected in the class emp? Explain with example

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!