Programming Exercise 12 "Design a new type called payroll" and Exercise 13 Write a Program that generates the weekly payroll In case you don't have the textbook, here are the problems (You can implement both in the same program, No need for two separate programs):
12.Design a new type called payrollT that is capable of holding the data for a list of employees, each of which is represented using the employeeT type introduced in the section on "Dynamic records" at the end of the chapter. The type payrollT should be a pointer type whose underlying value is a record containing the number of employees and a dynamic array of the actual employeeT values, as illustrated by the following data diagram: see image.
After writing the types that define this data structure, write a function GetPayroll that reads in a list of employees, as shown in the following sample run: see image.
After the input values have been entered, the GetPayroll function should return a value of type payrollT that matches the structure shown in the diagram.
13.Write a program that generates the weekly payroll for a company whose employment records are stored using the type payrollT, as defined in the preceding exercise. Each employee is paid the salary given in the employee record, after deducting taxes. Your program should compute taxes as follows:
For example, Bob Cratchit has a weekly income of $15. Because he has seven dependents, his adjusted income is $15 - (7 x $1), or $8. Twenty-five percent of $8 is $2, so Mr. Cratchit's net pay is $15 $2, or $13.
The payroll listing should consist of a series of lines, one per employee, each of which contains the employee's name, gross pay, tax, and net pay. The output should be formatted in columns, as shown in the following sample run: see image.