Question
Use a separate .py script file for each exercise and submit in a single compressed (zip) file. 2: Rewrite your pay computation with time-and-a-half for
Use a separate .py script file for each exercise and submit in a single compressed (zip) file.
2: Rewrite your pay computation with time-and-a-half for overtime and create a function called computepay which takes two parameters (hours and rate).
Enter Hours: 45 Enter Rate: 10 Pay: 475.0 3: Rewrite the grade program from the previous chapter using a function called computegrade that takes a score as its parameter and returns a grade as a string.
Score Grade >= 0.9 A >= 0.8 B >= 0.7 C >= 0.6 D < 0.6 F Enter score: 0.95 A Enter score: perfect Bad score Enter score: 10.0 Bad score Enter score: 0.75 C Enter score: 0.5 F Run the program repeatedly to test the various different values for input.
4: How Much Insurance? Many financial experts advise that property owners should insure their homes or buildings for at least 80 percent of the amount it would cost to replace the structure. Write a program that asks the user to enter the replacement cost of a building, then displays the minimum amount of insurance he or she should buy for the property. You should write a function for each task in the program.
5: Property Tax A county collects property taxes on the assessment value of property, which is 60 percent of the propertys actual value. For example, if an acre of land is valued at $10,000, its assessment value is $6,000. The property tax is then 72 for each $100 of the assessment value. The tax for the acre assessed at $6,000 will be $43.20. Write a program that asks for the actual value of a piece of property and displays the assessment value and property tax. You should write a function for each task in the program.
6: Stadium Seating There are three seating categories at a stadium. Class A seats cost $20, Class B seats cost $15, and Class C seats cost $10. Write a program that asks how many tickets for each class of seats were sold, then displays the amount of income generated from ticket sales. You should write a function for each task in the program.
7: Monthly Sales Tax A retail company must file a monthly sales tax report listing the total sales for the month, and the amount of state and county sales tax collected. The state sales tax rate is 5 percent and the county sales tax rate is 2.5 percent. Write a program that asks the user to enter the total sales for the month. From this figure, the application should calculate and display the following: The amount of county sales tax The amount of state sales tax The total sales tax (county plus state)
You should write a function for each task in the program.
8: Math Quiz Write a program that gives simple math quizzes. The program should display two random numbers that are to be added, such as: 247 + 129 The program should allow the student to enter the answer. If the answer is correct, a message of congratulations should be displayed. If the answer is incorrect, a message showing the correct answer should be displayed. You should write a function for each task in the program.
9: Falling Distance When an object is falling because of gravity, the following formula can be used to determine the distance the object falls in a specific time period: d=1/2gt2 The variables in the formula are as follows: d is the distance in meters, g is 9.8, and t is the amount of time, in seconds, that the object has been falling. Write a function named falling_distance that accepts an objects falling time (in seconds) as an argument. The function should return the distance, in meters, that the object has fallen during that time interval.
10: Future Value Suppose you have a certain amount of money in a savings account that earns compound monthly interest, and you want to calculate the amount that you will have after a specific number of months. The formula is as follows: F=P(1+i)t The terms in the formula are: F is the future value of the account after the specified time period. P is the present value of the account. i is the monthly interest rate. t is the number of months. Write a program that prompts the user to enter the accounts present value, monthly interest rate, and the number of months that the money will be left in the account. The program should pass these values to a function that returns the future value of the account, after the specified number of months. The program should display the accounts future value. You should write a function for each task in the program.
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started