n this employee's payslip program using python langauge, please create a flowchart of this employee's payslip program. Thank you. # 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("\n---------------------EMPLOYEE'S PAYSLIP
In this employee's payslip
# 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("\n---------------------EMPLOYEE'S PAYSLIP---------------------\n")
# 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
Solved in 4 steps with 2 images