Section 3

.pdf

School

Southern New Hampshire University *

*We aren’t endorsed by this school

Course

140

Subject

Computer Science

Date

Apr 3, 2024

Type

pdf

Pages

2

Uploaded by DeaconCaterpillar4154

3.13 LAB: Exact change Write a program with total change amount as an integer input, and output the change using the fewest coins, one coin type per line. The coin types are Dollars, Quarters, Dimes, Nickels, and Pennies. Use singular and plural coin names as appropriate, like 1 Penny vs. 2 Pennies. Ex: If the input is: 0 (or less than 0), the output is: No change Ex: If the input is: 45 the output is: 1 Quarter 2 Dimes 553398.3976864.qx3zqy7 LAB ACTIVITY 3.13.1: LAB: Exact change 10 / 10 When done developing your program, press the Submit for grading button below. This will submit your program for auto-grading. Coding trail of your work 3/25 M -10 min:0 Latest submission - 1:54 AM EDT on 03/25/24 Submission passed all tests Total score: 10 / 10 Only show failing tests 1:Compare output 2 / 2 Input 45 Your output 1 Quarter 2 Dimes 2:Compare output 2 / 2 Input 0 Your output No change 3:Compare output 2 / 2 Input 156 Your output 1 Dollar 2 Quarters 1 Nickel 1 Penny 4:Compare output 2 / 2 Input 300 Your output 3 Dollars 5:Compare output 2 / 2 Input 141 main.py Load default template... print ( Dollars ) if num_quarters > 0: print ( str ( num_quarters ), end = "" ) if num_quarters == 1: print ( " Quarter" ) else : print ( " Quarters" ) if num_dimes > 0: print ( str ( num_dimes ), end = "" ) if num_dimes == 1: print ( " Dime" ) else : print ( " Dimes" ) if num_nickels > 0: print ( str ( num_nickels ), end = "" ) if num_nickels == 1: print ( " Nickel" ) Develop mode Submit mode Submit for grading What is this? Download this submission 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46
Your output 1 Dollar 1 Quarter 1 Dime 1 Nickel 1 Penny Feedback?
Your preview ends here
Eager to read complete document? Join bartleby learn and gain access to the full version
  • Access to all documents
  • Unlimited textbook solutions
  • 24/7 expert homework help