Write a program that calculates pay for either an hourly paid worker or a salaried worker. Hourly paid workers are paid
Posted: Thu Jul 14, 2022 2:17 pm
Write a program that calculates pay for either an hourly paidworker or a salaried worker. Hourly paid workers are paid theirhourly pay rate times the number of hours worked. Salaried workersare paid their regular salary plus any bonus they may have earned.The program should declare two structures for the followingdata:
The program should also declare a union with two members. Eachmember should be a structure variable: one for the hourly paidworker and another for the salaried worker.
The program should ask the user whether he or she is calculatingthe pay for an hourly paid worker or a salaried worker. Regardlessof which the user selects, the appropriate members of the unionwill be used to store the data that will be used to calculate thepay.
Input Validation: Do not accept negative numbers. Do not acceptvalues greater than 80 for HoursWorked.
The program should also declare a union with two members. Eachmember should be a structure variable: one for the hourly paidworker and another for the salaried worker.
The program should ask the user whether he or she is calculatingthe pay for an hourly paid worker or a salaried worker. Regardlessof which the user selects, the appropriate members of the unionwill be used to store the data that will be used to calculate thepay.
Input Validation: Do not accept negative numbers. Do not acceptvalues greater than 80 for HoursWorked.