Write a program to compute the salary of XYZ company employee. An XYZ employee can either be an hourly-rated worker or a commission-based salesperson. Your program should first prompt the user to enter 1 if the employee is an hourly rated worker and 2 if the employee is a salesperson.
If the user enters 1 (hourly rated worker), the program should prompt the user to enter the hours worked and the hourly rate. The program should then compute and print the gross salary with the assumption that hours in excess of 40 is paid at 1.5 times the normal rate.
If the user enters 2 instead, the program should prompt the user to enter the sales value and the commission rate. Compute and print the gross salary assuming XYZ salesperson is paid a fixed salary of $500 in addition to the sales based variable component set to sales amount times the commission rate.
Finally, compute the tax which is set to a flat rate of 30% for all employees and print both the tax and the net salary (The code for computing and printing the tax and the net salary should be common to all employees).
Aucun commentaire:
Enregistrer un commentaire