21.4k views
1 vote
write a script that will turn a number read off a machine into a letter quality grade the script will ask the user to enter the machine's reading the script will turn that reading into a letter grade and print that grade

1 Answer

4 votes

Answer: (Python)

# Ask user for machine reading

reading = int(input("Enter the machine reading: "))

# Convert reading to letter grade

if reading >= 90:

grade = "A"

elif reading >= 80:

grade = "B"

elif reading >= 70:

grade = "C"

elif reading >= 60:

grade = "D"

else:

grade = "F"

# Print letter grade

print("The letter quality grade is:", grade)

Step-by-step explanation:

This script first prompts the user to enter the machine reading using the input() function and converts it to an integer using int(). It then uses a series of if statements to determine the letter grade based on the reading value. Finally, it prints the letter grade using the print() function.

User Mojo Risin
by
7.4k points

No related questions found