Academic Integrity: tutoring, explanations, and feedback — we don’t complete graded work or submit on a student’s behalf.

Using python This program should prompt the user to enter an exact multiple of 1

ID: 3785849 • Letter: U

Question

Using python This program should prompt the user to enter an exact multiple of 19 that is greater than 200. Then, the program should analyze the input and display a response to each of the four possible results of the analysis. See sample runs below.

Enter an exact multiple of 19 that is greater than 200 76

No, 76 is a multiple of 19 but it is not greater than 200

>>>

Enter an exact multiple of 19 that is greater than 200 55

55 is not over 200 and also is not a multiple of 19

>>>

Enter an exact multiple of 19 that is greater than 200 222

222 is over 200 but is not a multiple of 19

>>>

Enter an exact multiple of 19 that is greater than 200 380

Good input. 19 divides into 380 exactly 20 times

Explanation / Answer

value = int(input("Enter an exact multiple of 19 that is greater than 200 "))
if value > 200 and value % 19 == 0:
print ("Good input. 19 divides into "+str(value)+" exactly "+str(value / 19)+" times")
elif value > 200 and value % 19 != 0:
print (str(value)+" is over 200 but is not a multiple of 19")
elif value <= 200 and value % 19 != 0:
print (str(value)+" is not over 200 and also is not a multiple of 19")
else:
print ("No, "+str(value)+" is a multiple of 19 but it is not greater than 200")

Output:

sh-4.3$ python3 main.py                                                                                                                                                                                                                                

Enter an exact multiple of 19 that is greater than 200 380                                                                                                                                                                                             

Good input. 19 divides into 380 exactly 20.0 times                                                                                                                                                                                                     

sh-4.3$ python3 main.py                                                                                                                                                                                                                                

Enter an exact multiple of 19 that is greater than 200 222                                                                                                                                                                                             

222 is over 200 but is not a multiple of 19                                                                                                                                                                                                            

sh-4.3$ python3 main.py                                                                                                                                                                                                                                

Enter an exact multiple of 19 that is greater than 200 55                                                                                                                                                                                              

55 is not over 200 and also is not a multiple of 19                                                                                                                                                                                                    

sh-4.3$ python3 main.py                                                                                                                                                                                                                                

Enter an exact multiple of 19 that is greater than 200 76                                                                                                                                                                                              

No, 76 is a multiple of 19 but it is not greater than 200

Hire Me For All Your Tutoring Needs
Integrity-first tutoring: clear explanations, guidance, and feedback.
Drop an Email at
drjack9650@gmail.com
Chat Now And Get Quote