print("Welcome To Use Python Service.") respond = input("Are you want to handle a transaction ?(Y/N):").upper() #validation of respond while respond != "Y" and respond != "N" : print("Please enter 'Y' or 'N'") respond = input("Are you want to handle a transaction ?(Y/N):").upper() while respond == "Y": holidaybonus = 0.03 extrabonus = 0.05 _pension = 0.04 print("Please fill in your personal information.") name = input("Username:").upper() #validation of name while not name.replace(" ","").isalpha() : print("Invalid name.") name = input("Username:").upper() payment = input("Monthly payment:") #validation of payment while not payment.replace(".","").isdigit(): print("Invalid input.Please digits only !") payment = input("Monthly payment:") payment = eval(payment) public_holiday = input("Worked on public holiday(Y/N):").upper() #validation of public_holiday while public_holiday != "Y" and public_holiday != "N" : print("Invalid input.Please enter 'Y' or 'N'") public_holiday = input("Worked on public holiday(Y/N):").upper() hours = input("Total hours worked in a month:") #validation of hours while not hours.replace(".","").isdigit(): print("Invalid input.Please digits only !") hours = input("Total hours worked in a month:") hours = eval(hours) pension = input("Made payment of pension(Y/N):").upper() #validation of pension while pension != "Y" and pension != "N" : print("Please enter 'Y' or 'N'") pension = input("Made payment of pension(Y/N):").upper() if public_holiday == "Y": total_1 = (payment * holidaybonus) else: total_1 = 0 if hours >= 160: total_2 = (payment * extrabonus) else: total_2 = 0 if pension == "Y": total_3 = (payment * _pension) else: total_3 = 0 net_pay = payment + total_1 + total_2 - total_3 total_addition = payment + total_1 + total_2 print("_" * 37) print("PAYSLIP") print("Company's name : TARUC SDN.BHD.") print("Employee's name :",name) print("Pay Period : NOV 2021") print("_" * 37) print("{0:<20s}{1:>1s}{2:>15s}{1:>1s}".format("Remuneration","|","Amount(RM)")) print("{0:<20s}{1:>1s}{2:>15s}{1:>1s}".format("Monthly Payment","|",format(payment,',.2f'))) print("{0:<20s}{1:>1s}{2:>15s}{1:>1s}".format("Holiday Bonus","|",format(total_1,',.2f'))) print("{0:<20s}{1:>1s}{2:>15s}{1:>1s}".format("Extra Time Bonus","|",format(total_2,',.2f'))) print("-" * 37) print("{0:<20s}{1:>1s}{2:>15s}{1:>1s}".format("Total Addition","|",format(total_addition,',.2f'))) print("-" * 37) print("_" * 37) print("{0:<20s}{1:>1s}{2:>15s}{1:>1s}".format("Deduction","|","Amount(RM)")) print("{0:<20s}{1:>1s}{2:>15s}{1:>1s}".format("Pension Payment","|",format(total_3,',.2f'))) print("-" * 37) print("{0:<20s}{1:>1s}{2:>15s}{1:>1s}".format("Total Deduction","|",format(total_3,',.2f'))) print("-" * 37) print("_" * 37) print("{0:<20s}{1:>1s}{2:>15s}{1:>1s}".format("Net Pay","|",format(net_pay,',.2f'))) print("_" * 37) print("_" * 37) respond = input("Is there another employee to handle a transaction ?(Y/N):").upper() while respond != "Y" and respond != "N" : print("Please enter 'Y' or 'N'") respond = input("Is there another employee to handle a transaction ?(Y/N):").upper() if respond == "N": print("Thank You For Using Python Service.") show the flowchart of the programme above
print("Welcome To Use Python Service.")
respond = input("Are you want to handle a transaction ?(Y/N):").upper()
#validation of respond
while respond != "Y" and respond != "N" :
print("Please enter 'Y' or 'N'")
respond = input("Are you want to handle a transaction ?(Y/N):").upper()
while respond == "Y":
holidaybonus = 0.03
extrabonus = 0.05
_pension = 0.04
print("Please fill in your personal information.")
name = input("Username:").upper()
#validation of name
while not name.replace(" ","").isalpha() :
print("Invalid name.")
name = input("Username:").upper()
payment = input("Monthly payment:")
#validation of payment
while not payment.replace(".","").isdigit():
print("Invalid input.Please digits only !")
payment = input("Monthly payment:")
payment = eval(payment)
public_holiday = input("Worked on public holiday(Y/N):").upper()
#validation of public_holiday
while public_holiday != "Y" and public_holiday != "N" :
print("Invalid input.Please enter 'Y' or 'N'")
public_holiday = input("Worked on public holiday(Y/N):").upper()
hours = input("Total hours worked in a month:")
#validation of hours
while not hours.replace(".","").isdigit():
print("Invalid input.Please digits only !")
hours = input("Total hours worked in a month:")
hours = eval(hours)
pension = input("Made payment of pension(Y/N):").upper()
#validation of pension
while pension != "Y" and pension != "N" :
print("Please enter 'Y' or 'N'")
pension = input("Made payment of pension(Y/N):").upper()
if public_holiday == "Y":
total_1 = (payment * holidaybonus)
else:
total_1 = 0
if hours >= 160:
total_2 = (payment * extrabonus)
else:
total_2 = 0
if pension == "Y":
total_3 = (payment * _pension)
else:
total_3 = 0
net_pay = payment + total_1 + total_2 - total_3
total_addition = payment + total_1 + total_2
print("_" * 37)
print("PAYSLIP")
print("Company's name : TARUC SDN.BHD.")
print("Employee's name :",name)
print("Pay Period : NOV 2021")
print("_" * 37)
print("{0:<20s}{1:>1s}{2:>15s}{1:>1s}".format("Remuneration","|","Amount(RM)"))
print("{0:<20s}{1:>1s}{2:>15s}{1:>1s}".format("Monthly Payment","|",format(payment,',.2f')))
print("{0:<20s}{1:>1s}{2:>15s}{1:>1s}".format("Holiday Bonus","|",format(total_1,',.2f')))
print("{0:<20s}{1:>1s}{2:>15s}{1:>1s}".format("Extra Time Bonus","|",format(total_2,',.2f')))
print("-" * 37)
print("{0:<20s}{1:>1s}{2:>15s}{1:>1s}".format("Total Addition","|",format(total_addition,',.2f')))
print("-" * 37)
print("_" * 37)
print("{0:<20s}{1:>1s}{2:>15s}{1:>1s}".format("Deduction","|","Amount(RM)"))
print("{0:<20s}{1:>1s}{2:>15s}{1:>1s}".format("Pension Payment","|",format(total_3,',.2f')))
print("-" * 37)
print("{0:<20s}{1:>1s}{2:>15s}{1:>1s}".format("Total Deduction","|",format(total_3,',.2f')))
print("-" * 37)
print("_" * 37)
print("{0:<20s}{1:>1s}{2:>15s}{1:>1s}".format("Net Pay","|",format(net_pay,',.2f')))
print("_" * 37)
print("_" * 37)
respond = input("Is there another employee to handle a transaction ?(Y/N):").upper()
while respond != "Y" and respond != "N" :
print("Please enter 'Y' or 'N'")
respond = input("Is there another employee to handle a transaction ?(Y/N):").upper()
if respond == "N":
print("Thank You For Using Python Service.")
show the flowchart of the programme above
![](/static/compass_v2/shared-icons/check-mark.png)
Step by step
Solved in 4 steps with 5 images
![Blurred answer](/static/compass_v2/solution-images/blurred-answer.jpg)
![Computer Networking: A Top-Down Approach (7th Edi…](https://www.bartleby.com/isbn_cover_images/9780133594140/9780133594140_smallCoverImage.gif)
![Computer Organization and Design MIPS Edition, Fi…](https://www.bartleby.com/isbn_cover_images/9780124077263/9780124077263_smallCoverImage.gif)
![Network+ Guide to Networks (MindTap Course List)](https://www.bartleby.com/isbn_cover_images/9781337569330/9781337569330_smallCoverImage.gif)
![Computer Networking: A Top-Down Approach (7th Edi…](https://www.bartleby.com/isbn_cover_images/9780133594140/9780133594140_smallCoverImage.gif)
![Computer Organization and Design MIPS Edition, Fi…](https://www.bartleby.com/isbn_cover_images/9780124077263/9780124077263_smallCoverImage.gif)
![Network+ Guide to Networks (MindTap Course List)](https://www.bartleby.com/isbn_cover_images/9781337569330/9781337569330_smallCoverImage.gif)
![Concepts of Database Management](https://www.bartleby.com/isbn_cover_images/9781337093422/9781337093422_smallCoverImage.gif)
![Prelude to Programming](https://www.bartleby.com/isbn_cover_images/9780133750423/9780133750423_smallCoverImage.jpg)
![Sc Business Data Communications and Networking, T…](https://www.bartleby.com/isbn_cover_images/9781119368830/9781119368830_smallCoverImage.gif)