Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

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,

image text in transcribed

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 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

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

AutoCAD Database Connectivity

Authors: Scott McFarlane

1st Edition

0766816400, 978-0766816404

More Books

Students also viewed these Databases questions