Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

using python Recal yesterday's Pe where you were given an integer vele less than 20. Based on the ruder giver, you calculated the combination of

image text in transcribedimage text in transcribed

using python

Recal yesterday's Pe where you were given an integer vele less than 20. Based on the ruder giver, you calculated the combination of ten and five dollar bils, toonies (2 dollercors) end lories I della cors) reeded to pay such that you pay usra as many of the largest bills/coins first A solution to this problem has been given to you. You are going to modify that problem so that an error message is output the value given to you as input is NOT an integer from 0 to 19. You my wish to the use of the exime Details Input Input contar + the input (rad in for you to a variable named value is SUPPOSEDto be a positive Integer that is less than 20 Processing This is already handled by the program The program docians and initiates thatollowing Integer variables: . tens: number of ten da lorbis required. Tives number of live dalili needed later ters are paid towards valuel Loonier:number of bas dalar coins nondalabarters and vns are paid) . loonies: number of one dollar insaned alteriors, tives and tapnies are paid You must modify the program to ensure proper input. . You will outpu. "Input error" if de dollar amount value is: not ar ingor or not in the margarita 19 inclusive Output Aside from the modification described above ourout k taken care o for you Sample input/output: Input Output Inget error value = input() ###### # MODIFY so that you: # Check if numeric and in an integer from 0 to 19 # + If so, calculate as described + If not, print "Input error" # Note: There are hints in the "Hints & Tips" section if you need a little help # #Convert to integer value = int(value) #Calculate the number of tens needed tens = value/10 value = value%10 #Calculate the number of fivers needed fives = value//5 value = value%5 #Calculate the number of toonies needed toonies = value/2 #Calculate the number of loonies needed loonies = value%2 print( tens, "$10 bills") print( fives, "$5 bills") print( toonies, "toonies") print( loonies, "loonies")

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Students also viewed these Databases questions

Question

u = 5 j , v = 6 i Find the angle between the vectors.

Answered: 1 week ago