Academic Integrity: tutoring, explanations, and feedback — we don’t complete graded work or submit on a student’s behalf.

In python3 code. Business P5.23, Write a program that prints a paycheck. Ask the

ID: 3918784 • Letter: I

Question

In python3 code. Business P5.23, Write a program that prints a paycheck. Ask the program user for the name of the employee, the hourly rate, and the number of hours worked. If the number of hours exceeds 40, the employee is paid "time and a half", that is, 150 percent of the hourly rate on the hours exceeding 40. Your check should look similar to that in the figure below. Use ficitious names for the payer and the bank. Be sure to use stepwise refinement and break your solution into several functions. Use the intName function to print the dollar amount of the check.

es.21 In Exercise P3.28 you were asked to write a program to convert a number to its inng Exercises 307 representation in Roman numerals. At the time, vou did not know how to eliminate duplicate code, and as a consequence the resulting program was rather long that program by implementaing and using the following function def ronanDigit(n, one, five, ten) That function translates one digit, specified for the one, five, and ten values. You would call the function as follows: using the strings ronan0nes--romanDigit(n % 10, "1", "V", "X") n-n// 10 romanTens-romanDigitin % 10, "X", "L", "C") . Business P5.22 Write a function that computes the balance of a bank account with a given initial balance and interest rate, after a given number of years. Assume interest is com- pounded yearly . Business PS.23 Write a program that prints a paycheck. Ask the program user for the name of the employee, the hourly rate, and the number of hours worked. If the number of hours exceeds 40, the employee is paid "time and a half", that is, 150 percent of the hourly rate on the hours exceeding 40. Your check should look similar to that in the fig ure below. Use fictitious names for the payer and the bank. Be sure to use stepwise refinement and break your solution into several functions. Use the intName function to print the dollar amount of the check. TWO HUNDRED SEVENTY FOUR AND 15/100R TO THE ORDER OF JOHN DCE 1009 Frankin Blvd Sunnyvala, CA 95014 ':47aioa 2401: 200 G 2037 ?301 Business P5.24 Write a program that prints instructions to get coffee, asking the user for input whenever a decision needs to be made. Decompose each task into a function, for example: def brewCoffeeO: print("Add water to the coffee maker.") print("Put a filter in the coffee maker.") grindCoffee) print("Put the coffee in the filter.") Business Ps.25 Postal bar codes. For faster sorting of letters, the United States Postal Service encour- ages companies that send large volumes of mail to use a bar code denoting the zip code (see Figure 10). The encoding scheme for a five-digit zip code is shown in Figure 11. There are full-height frame bars on each side. The five encoded digits are followed by a check ed as fallows: Add up all digits, and choose the check digit to

Explanation / Answer

user = str

end = False

hours = round(40,2)

print("One Stop Shop Payroll Calculator")

while end == False:

user = input(" Please enter your name or type '0' to quit: ")

if user == "0":

print("End of Report")

break

else:

hours = (float(input("Please enter hours worked: ", )))

payrate =(float(input("Please enter your payrate: $", )))

if hours <= 40:

print("Employee's name: ", user)

print("Overtime hours: 0")

print("Overtime Pay: $0.00")

regularpay = round(hours * payrate, 2)

print("Gross Pay: $", regularpay)

elif hours > 40:

overtimehours = round(hours - 40.00,2)

print("Overtime hours: ", overtimehours)

print("Employee's name: ", user)

regularpay = round(hours * payrate,2)

overtimerate = round(payrate * 1.5, 2)

overtimepay = round(overtimehours * overtimerate)

grosspay = round(regularpay+overtimepay,2)

print("Regular Pay: $", regularpay)

print("Overtime Pay: $",overtimepay)

print("Gross Pay: $", grosspay)

print("Welcome to PayCalc! ")

wage = float(input("How much do you make per hour? "))

hours = float(input("How many hours for the week? "))

def as_currency(amount):

if amount >= 0:

return '${:,.2f}'.format(amount)

else:

return '-${:,.2f}'.format(-amount)

if hours <= 40:

weekincome = wage*hours

monthincome = weekincome*4

print("It has been calculated that if you work {} hours at a rate of {}, you should make a total of {}/week ({}/month)".format(int(round(hours)),as_currency(wage),as_currency(weekincome),as_currency(monthincome)))

else:

regularpay = wage*40

overtimehours = hours - 40

overtimerate = wage*1.5

overtimeincome = (overtimehours * overtimerate)

print("Regular pay: {}/wk + your overtime rate of {}/hr".format(as_currency(regularpay),as_currency(overtimerate)))

print("Hours of overtime: {}".format(int(round(overtimehours))))

print("Total overtime income: {}".format(as_currency(overtimeincome)))

weekincome = (40*wage) + overtimeincome

#if worked overtime every week

monthincome = weekincome*4

overtimeonce = weekincome + (regularpay*3)

print("It has been calculated that you should make a total of {}/week with overtime ({}/month) if worked {} hours every week. If worked {} hours during one week and 40 hours/wk every other week, you'd make {} for the month".format(as_currency(weekincome),as_currency(monthincome),int(round(hours)),int(round(hours)),as_currency(overtimeonce)))

for example

Welcome to PayCalc!

How much do you make per hour?

19.12

How many hours for the week?

40

It has been calculated that if you work 40 hours at a rate of $19.12, you should make a total of $764.80/week ($3,059.20/month)

Welcome to PayCalc!

How much do you make per hour?

19.12

How many hours for the week?

60

Regular pay: $764.80/wk + your overtime rate of $28.68/hr

Hours of overtime: 20

Total overtime income: $573.60

It has been calculated that you should make a total of $1,338.40/week with overtime ($5,353.60/month) if worked 60 hours every week.

If worked 60 hours during one week and 40 hours/wk every other week, you'd make $3,632.80 for the month

Hire Me For All Your Tutoring Needs
Integrity-first tutoring: clear explanations, guidance, and feedback.
Drop an Email at
drjack9650@gmail.com
Chat Now And Get Quote