Question: Write simple C++ code for the following: use only simple #include library, add comments and show output Declare a class Salary it should have the

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) . a constructor that takes a name, a salary object and job description and assigns these to the members of the new object. 1. Declare memory (or char array) to copy the name in. 2. store the location of this array in the pointer called namePtr 3. Copy the contents of salary type argument to the salary member variable. 4. Declare memory or char array to copy the job description in. 5. store the location of this array in the pointer called DescPtr a print function that prints out the members of the object
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
