In each of the projects that follow, you should write a program that contains an introductory docstring. This documentation should describe what the program will do (analysis) and how it will do it (design the program in the form of a pseudocode algorithm). Include suitable prompts for all inputs, and label all outputs appropri- ately. After you have coded a program, be sure to test it with a reasonable set of legitimate inputs.
1 The tax calculator program of the case study outputs a floating-point number that might show more than two digits of precision. Use the round function to modify the program to display at most two digits of precision in the output number.
2 You can calculate the surface area of a cube if you know the length of an edge. Write a program that takes the length of an edge (an integer) as input and prints the cube’s surface area as output.
10 An employee’s total weekly pay equals the hourly wage multiplied by the total number of regular hours plus any overtime pay. Overtime pay equals the total overtime hours multiplied by 1.5 times the hourly wage. Write a program that takes as inputs the hourly wage, total regular hours, and total overtime hours and displays an employee’s total weekly pay.
*******Please Can you use python IDLE to help solve this questions for me?*******
Thanks for the question. Here is the completed code for this problem. Comments are included, go through it, learn how things work and let me know if you have any doubts or if you need anything to change. If you are satisfied with the solution, please rate the answer. Thanks =========================================================================== #1 The tax calculator program of the case study outputs a floating-point number # that might show more than two digits of precision. Use the round function to # modify the program to display at most two digits of precision in the output number. # we can round a floating point number using the round() function # given a floating point number pi = 3.141593 # we can round it to 2 decimals using the below code pi=31.141593 print(round(pi,2)) # round takes two argument, the variable name and the precisions here its 2 #2 You can calculate the surface area of a cube if you know the length of an edge. # Write a program that takes the length of an edge (an integer) # as input and prints the cube’s surface area as output. # ask user for cube length, convert the input to int edge=int(input('Enter cubes length: ')) #calculate area using the formula 6 sides x area of each side surface_area=6*edge*edge #print the area print('Total surface area: {}'.format(surface_area)) #10 An employee’s total weekly pay equals the hourly wage multiplied by the total # number of regular hours plus any overtime pay. Overtime pay equals the total # overtime hours multiplied by 1.5 times the hourly wage. # Write a program that takes as inputs the hourly wage, total regular hours, # and total overtime hours and displays an employee’s total weekly pay. hourly_wage=float(input('Enter employee hourly wage: ')) regular_hours=int(input('Enter employee total regular hours: ')) overtime_hours=int(input('Enter overtime hours: ')) #calculate weekly pay weekly_pay = regular_hours*hourly_wage + overtime_hours*hourly_wage*1.5 print('Total weekly pay: ${}'.format(round(weekly_pay,2)))
==============================================================
Get Answers For Free
Most questions answered within 1 hours.