Question: Write simple C++ code, using only #include library, add comments and show output. Declare a class Salary it should have the following members i. An

Write simple C++ code, using only #include library, add comments and show output.
Write simple C++ code, using only #include library, add comments and show
output. Declare a class Salary it should have the following members i.

Declare a class Salary it should have the following members i. An integer called pay Amount (holds the amount of salary) ii. A float called income Tax Percentage (holds the % of income that is deducted as tax) Declare a class Staff it should have the following members: i. a char pointer to point to a name called namePtr (to save a location of the char array that holds the name) ii. an object of class Salary iii. a char pointer to point to the job description called jDescPtr (to save a location of the char array that holds the job description) iii. i. Declare an object of type Salary and give the object some values ii. Declare a pointer of type Salary and assign it the address of the object from i) What is the size of the object in i) in bytes. Explain the size you have mentioned. iv. What is the size of the pointer in ii) in bytes. Explain the size you have mentioned. Use the pointer in ii) to change the values of the member variables of the object it is pointing to V

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!