Answer:
Following is the program in the python language
hr = input("input hours:") #Read input by user
h1 = float(hr)
rate =input("Input Rate:") #Read RATE BY USER
r1 = float(rate) #CONVERT INTO FLOAT
if h1 <= 40: #check condition
t=h1 * r1
print (t) #DISPLAY
else :#else block
t1=(40 * r1) + (h1 -40) * r1 * 1.5
print('The pay is :')
print(t1)#DISPLAY
Output:
input hours:45
Input Rate:10.50
The pay is :
498.75
Step-by-step explanation:
Following are the description of program
- Read the value of hour in the "hr" variable and convert into the float value in the "h1" variable .
- Read the value of rate in the " rate" variable and convert into the float value in the "r1" variable .
- After that check the condition of hour if block if the hour is less then or equal to 40 then it multiplied h1 *t1 otherwise else block will be executed and print the value of pay .