Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

In this program create a flow chart # read the name of the employee name = input(Enter employee's name:) # read number of hours worked

In this program create a flow chart # read the name of the employee name = input("Enter employee's name:") # read number of hours worked and convert it to integer using int() hours = int(input('Enter number of hours worked in a week:')) # read hourly rate and convert it to float using float() hourly_rate = float(input('Enter hourly pay rate:')) # read federal tax rate and convert it to float using float() federal_tax = float(input('Enter federal tax withholding rate:')) # read state tax rate and convert it to float using float() state_tax = float(input('Enter state tax withholding rate:')) # print the employee pay slip print(" ---------------------EMPLOYEE'S PAYSLIP--------------------- ") # print the name of the employee print(f"Employee's Name: {name}") # print number of hours worked print(f"Hours Worked: {hours}") # print hourly rate of the employee print(f"Pay Rate: $ {hourly_rate}") # calculate the gross pay # gross pay is number of hours multiplied by hourly rate gross_pay = hours*hourly_rate # print gross pay print(f"Gross Pay: $ {gross_pay}") # print all types of deductions print("Deductions:") # calculate federal deduction federal = federal_tax*gross_pay # it is federal rate times gross pay # calculate state deduction state = state_tax*gross_pay # it is state rate times gross pay # calculate total deductions total_deductions = federal + state # it is sum of federal and state deduction # print federal deduction print(f'\t\tFederal Witholding( {federal_tax*100} %) : $ {federal}') # print state deduction print(f'\t\tState Witholding( {state_tax*100} %) : $ {state}') # print total deductions print(f'\t\tTotal Deduction: $ {total_deductions}') # calculate net pay net_pay = gross_pay-total_deductions # it is difference gross pay and total deductions # print net pay print(f'Net Pay:$ {net_pay}')

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Database Design Application And Administration

Authors: Michael Mannino, Michael V. Mannino

2nd Edition

0072880678, 9780072880670

More Books

Students also viewed these Databases questions

Question

How do modern Dashboards differ from earlier implementations?

Answered: 1 week ago