Computer Science, asked by prabhukumarsellamuth, 8 months ago

Write a program to prompt the user for hours and rate per hour using input to compute gross pay. Use 35 hours and a rate of 2.75 per hour to test the program (the pay should be 96.25). You should use input to read a string and float() to convert the string to a number. Do not worry about error checking or bad user data.

Answers

Answered by anvitanvar032
3

Answer:

The correct answer to this question is # to compute gross pay by hours and rate per hour, hrs=input("Enter Hour:"), rate=input("Enter Rate per Hour:"),  pay=float(hrs)*float(rate),  print("Pay:", pay)

Explanation:

Given - Use 35 hours and a rate of 2.75 per hour to test the program (the pay should be 96.25).

To Find - Write a program to prompt the user for hours and rate per hour using the input to compute gross pay.

1)  #compute gross pay by hours and rate per hour

2)  hrs=input("Enter Hour:")

3) rate=input("Enter Rate per Hour:")

4) pay=float(hrs)*float(rate)

5)  print("Pay:", pay)

A "string" of characters is exactly what a STRING is. anything that is not a "value," such as a letter or a phrase. A FLOAT is only a decimalized number. A FLOAT is essentially an INT with a decimal, whereas an INT is a complete number (no decimal).

#SPJ2

Similar questions