Respuesta :
Answer:
In Python:
loop = True
while(loop):
nm1 = float(input("Number 1: "))
nm2 = float(input("Number 2: "))
nm3 = float(input("Number 3: "))
if (nm1 >= 0 and nm2 >= 0 and nm3 >= 0):
result = nm2 * nm3 + nm1
print("Result: "+str(result))
loop = True
else:
print("All inputs must be greater than or equal to 0")
loop = True
Explanation:
First, we set the loop to True (a boolean variable)
loop = True
This while loop iterates, indefinitely
while(loop):
The next three lines prompt user for three numbers
nm1 = float(input("Number 1: "))
nm2 = float(input("Number 2: "))
nm3 = float(input("Number 3: "))
The following if condition checks if all of the numbers are greater than or equal to 0
if (nm1 >= 0 and nm2 >= 0 and nm3 >= 0):
If yes, the result is calculated
result = nm2 * nm3 + nm1
... and printed
print("Result: "+str(result))
The loop is then set to true
loop = True
else:
If otherwise, the user is prompted to enter valid inputs
print("All inputs must be greater than or equal to 0")
The loop is then set to true
loop = True