Home / Expert Answers / Computer Science / 3-13-lab-exact-change-write-a-progam-with-total-change-amount-as-an-integer-input-and-output-the-pa498

(Solved): 3.13 LAB: Exact change Write a progam with total change amount as an integer input, and output the ...




3.13 LAB: Exact change
Write a progam with total change amount as an integer input, and output the change using the fewest co
main.py
Enter program input (optional)
IT 140: Introduction to Scripting home \( >3.13 \) : LAB: Exact change
main.py
17 it nickels \( >0 \) and money \( >0 \) :
18
Enter program input (optional)
45
Run program \( \quad \) Input (from above) \( \longrightarrow \quad \) main.py
Pronram nutn
brary > IT 140 : Introduction to Scripting home > 3.13: LAB: Exact change
42 money \( = \) money \( -( \) dollars \( * 100) \
3.13 LAB: Exact change Write a progam with total change amount as an integer input, and output the change using the fewest cons, one coin type per line. The con types are Dollach, Quarters, Dimes, Nickels, and Pennies Use singular and plural coin names as appropeiate, like 1 Penny vis 2 Penniet Ex if the input is: (or less than 0), the ourput is No change Ex If the input is 45 the output is: 1 Qostret, 2. Direa \( 0 / 10 \) main.py Enter program input (optional) IT 140: Introduction to Scripting home \( >3.13 \) : LAB: Exact change main.py 17 it nickels \( >0 \) and money \( >0 \) : 18 money = money - (nickels * 5) 19 if nickels \( =1 \) : 20 print(nickels, "nickel") 21 elif nickels \( >1 \) : 22 print(nickels, "nickels") 23 if pennies \( >0 \) and money \( >0 \) : 24 money = money - (pennies * 1) 25 if pennies \( =1 \) : 26 print(pennies, "penny") 27 elif pennies \( >1 \) : 28 print(pennies, "pennies") 29 if dimes \( >0 \) and money \( >0: \) 30 money \( = \) money - (dimes \( \cdot 10) \) 31 if dimes \( =1: 1 \) 32 print(dimes, "dime") Run your program as often as you'd like, before submitt input values in the first box, then click Run program and second box. Enter program input (optional) Enter program input (optional) 45 Run program \( \quad \) Input (from above) \( \longrightarrow \quad \) main.py Pronram nutnuit disnlaved here - Python Remove...html brary > IT 140 : Introduction to Scripting home > 3.13: LAB: Exact change 42 money \( = \) money \( -( \) dollars \( * 100) \) 43 if dollars \( =100 \) : 44 print(dollars, "dollar") 45 elif dollars \( >1 \) : 46 print(dollars, "dollars") 47 48 Run your program as often a input values in the first box, second box. Enter program input (optional) 45 Input (from above) Program output displayed here 9 nickels 45 pennies 4 dimes 1 quarter Coding trail of your work


We have an Answer from Expert

View Expert Answer

Expert Answer


CODE: n=int(input()) if n<=0: print("No Change") else: d=n//100 n=n%100 q=n//25 n=n%25 di=n//10 n=n%10 ni=n//5
We have an Answer from Expert

Buy This Answer $5

Place Order

We Provide Services Across The Globe