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
People are still buying printed magazines?
BARSIC [14]
Yes, they are. 
Mostly dentists' offices, though.  
3 0
3 years ago
Who wants to give free points to me?
Bad White [126]

Answer:

I can :) just comment lol

3 0
3 years ago
Read 2 more answers
True / False<br> General purpose registers can be read and written by ML programs
Oduvanchick [21]

Answer: False

Explanation:

  General purpose register cannot be read and written by the Ml program because when ever the instruction decode the input and output unit are invoke for data to read in the memory and it can written to the output device from the memory. General purpose register stored both the addresses and the data in the file. In some cases ML only reads with the hep of special algorithm function.

6 0
3 years ago
Its Simple To delete Your Own Online Poste Or Photos But
tensa zangetsu [6.8K]

its not simple nothing never is deleted from online posts or photos

4 0
3 years ago
Read 2 more answers
What are the possible consequences of invasion of privacy?
Sergio039 [100]
Jail time since you can be considered a spy or a perv. Whatever you aim is of course.
7 0
3 years ago
Other questions:
  • I need help please?!!!
    15·1 answer
  • 286795991 número pra convidar no tiktok​
    11·2 answers
  • User-system interaction is?
    11·1 answer
  • Sedimentary rock formation occurs when igneous, metamorphic, or other sedimentary rocks are exposed to the unyielding forces of
    14·2 answers
  • Select the correct answer.
    12·1 answer
  • Match the personality traits with their description
    9·2 answers
  • What should you remember when using the thesaurus to replace words?
    8·2 answers
  • Which of the following provides services to hosts on its network?
    9·1 answer
  • Ken is a mobile app developer. He is designing a mobile app that offers tips and guidance to people interested in learning jazz
    8·2 answers
  • Alvin has created a non-extensive site map of all the commonly visited pages of his website. What is such a site map called?
    13·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!