Write a program to prompt the user for hours and rate per hour using input to compute gross pay. Pay the hourly rate for the hours up to 40 and 1.5 times the hourly rate for all hours worked above 40 hours. Use 45 hours and a rate of 10.50 per hour to test the program (the pay should be 498.75). You should use input to read a string and float() to convert the string to a number. This is Python code question
Answers
Answered by
0
Answer:
print('Enter Hours')
hours=int(input())
print('Rate per hour')
rate=float(input())
grosspay=0.00
if hours > 40:
grosspay=rate * 1.5 * hours
else:
grosspay=rate*hours
print('Calculated grosspay: '+str(grosspay) )
Explanation:
change the formula . looks like my formula is wrong or the question is somewhat wrong.
Similar questions
Computer Science,
5 months ago
Science,
5 months ago
Math,
11 months ago
Math,
11 months ago
India Languages,
1 year ago
English,
1 year ago