1answer.
Ask question
Login Signup
Ask question
All categories
  • English
  • Mathematics
  • Social Studies
  • Business
  • History
  • Health
  • Geography
  • Biology
  • Physics
  • Chemistry
  • Computers and Technology
  • Arts
  • World Languages
  • Spanish
  • French
  • German
  • Advanced Placement (AP)
  • SAT
  • Medicine
  • Law
  • Engineering
kykrilka [37]
3 years ago
12

Write a program to assist a cashier with determining correct change. The program should have one input, the number of cents to r

eturn to the customer. The output should be the appropriate change in quarters, dimes, nickels and cents.
Computers and Technology
1 answer:
SCORPION-xisa [38]3 years ago
5 0
```
#!/usr/local/bin/python3

import sys

coins = { "quarters" : 25, "dimes" : 10, "nickels" : 5, "pennies" : 1 }

def mkChange( balance, coin ):
    qty = balance // coins[ coin ]
    if( qty ):
        print( str( qty ) + ' ' + coin )
    return( balance % coins[ coin ] )

if( __name__ == "__main__" ):
    if( len( sys.argv ) == 2 ):
        balance = int( sys.argv[ 1 ] )
        balance = mkChange( balance, "quarters" )
        balance = mkChange( balance, "dimes" )
        balance = mkChange( balance, "nickels" )
        balance = mkChange( balance, "pennies" )
    else:
        sys.stderr.write( "\nusage: " + sys.argv[ 0 ] + " <change owed>\n" )
```


You might be interested in
Can you give me a long list of anime
aleksley [76]
Kill la Kill
Evangaleon
Blue Exorcist
The Devil is a Part Timer
Berserk
Death Note
K
A Boring World Where The Concept of Jokes Does not Exist
Psycho Pass
Elfen Lied
Soul Eater
Fairy Tale
Naruto
3 0
3 years ago
Read 2 more answers
Please answer fast screenshot included - thanks in advance
aleksley [76]

Answer:

Webpage Layouts where finally designed using html code

Explanation:

4 0
3 years ago
Which code returns the date in the format friday, april 20th, 2015?
Vera_Pavlovna [14]
<span>The answer is : DATE_FORMAT('2012-04-20', '%W, %M %D, %Y')
This is the </span><span>code that returns the date in the format friday, april 20th, 2015?</span>
6 0
3 years ago
Scripting languages are distinguished by their ____ types.
vodomira [7]
I believe the answer is font.
3 0
3 years ago
_ effects determine how slide elements disappear
kupik [55]
<span>Exit effects determine how slide elements disappear. </span>
6 0
3 years ago
Other questions:
  • ¿Cuál es el objetivo principal de los servicios?
    7·1 answer
  • Your desktop computer monitor is not displaying a picture. What would you do to troubleshoot the problem?
    7·2 answers
  • True or False: You cannot change the default margin size for Word documents.  
    6·1 answer
  • What is an unique text-based internet address corresponding to a computer's unique numeric IP address called
    8·1 answer
  • The version of Windows that first provided networking capabilities was _____.
    12·2 answers
  • Match the terms with their definitions.
    5·2 answers
  • Given an int variable k, an int array incompletes that has been declared and initialized, an int variable studentID that has bee
    10·1 answer
  • Assume that a picture is represented on a monitor screen by a rectangular array containing 2048 columns and 1536 rows of pixels.
    12·1 answer
  • Because Microsoft Access includes not only the software needed to create a database, but also the software needed to create form
    7·1 answer
  • Write a statement that compares the values of score1 and score2 and takes the following actions. When score1 exceeds score2, the
    7·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!