Using Python, write an algorithm for computing a weekly payroll where the user decides how many employees they’re going
Posted: Sun May 15, 2022 12:16 pm
Using Python, write an algorithm for computing a weekly payroll
where the user decides how many employees they’re going to pay to
and provides the paying info for each employee. (PLEASE do not use
an existing answer)
on that design with other tools and program it. As a refresher, what you must do is: Ask the user how many employees on payroll this week Ask how many hours worked and wage for each employee Compute: gross salary, net salary, overtime pay (if applicable) and tax and benefit deductions Display: gross salary, net salary and total deductions of each employee Compute the total of the payroll for the week (use the gross pay for this) Use the following constant values for your computations: o 18% tax deduction o 20% benefits deduction o 2 times the wage/hr for overtime hours o Consider regular hours up to 37.5 hours/week WHAT YOU NEED TO DO: a. Using Top-down design, prepare a hierarchy diagram on all the functions you would use in your code. Remember: a good design goes through this part first. b. Prepare IPO charts for all the functions you will use. c. Code the solution in Python. The code must use functions. Document your code thoroughly using the following guidelines: i. Above each function, you must explain its purpose, the variables it uses, which parameters it has (if any), the input it takes (if any), the value it should return (if any) and the output it produces (if any). ## ii. Separate the functions with commented lines (like the one above, for instance). You may use other commented elements as shown to organize and make it visually pleasant. ## iii. Your program will be evaluated in good programming techniques as well as in correctness. Avoid global variables and numeric literals. Avoid long functions; make your code modular. Avoid main() function doing much work. iv. Be clear and structured! Organization is very important for program maintenance and debugging. Also, document your work with comments.
where the user decides how many employees they’re going to pay to
and provides the paying info for each employee. (PLEASE do not use
an existing answer)
on that design with other tools and program it. As a refresher, what you must do is: Ask the user how many employees on payroll this week Ask how many hours worked and wage for each employee Compute: gross salary, net salary, overtime pay (if applicable) and tax and benefit deductions Display: gross salary, net salary and total deductions of each employee Compute the total of the payroll for the week (use the gross pay for this) Use the following constant values for your computations: o 18% tax deduction o 20% benefits deduction o 2 times the wage/hr for overtime hours o Consider regular hours up to 37.5 hours/week WHAT YOU NEED TO DO: a. Using Top-down design, prepare a hierarchy diagram on all the functions you would use in your code. Remember: a good design goes through this part first. b. Prepare IPO charts for all the functions you will use. c. Code the solution in Python. The code must use functions. Document your code thoroughly using the following guidelines: i. Above each function, you must explain its purpose, the variables it uses, which parameters it has (if any), the input it takes (if any), the value it should return (if any) and the output it produces (if any). ## ii. Separate the functions with commented lines (like the one above, for instance). You may use other commented elements as shown to organize and make it visually pleasant. ## iii. Your program will be evaluated in good programming techniques as well as in correctness. Avoid global variables and numeric literals. Avoid long functions; make your code modular. Avoid main() function doing much work. iv. Be clear and structured! Organization is very important for program maintenance and debugging. Also, document your work with comments.