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]
2 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]2 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
Which of the following symbols is a part of all spreadsheet functions?
NARA [144]

Answer:

the answer is B and is part of all spreadsheet functions

8 0
2 years ago
Read 2 more answers
What are the two categories of problems that we can simply convert<br> to parallel code?
anastassius [24]
Percentage and decimals
7 0
2 years ago
Which of the following transferable skills are generally the most looked for in the IT field?
san4es73 [151]
The correct option is D.
Transferable skills refers to those set of skills that do not belong to any specific field or industry, they are general skills and can be transferred from one job to another. Option D is the correct choice because all jobs require the employees to have problem solving skill, team building skills and communication skills; all these skills contribute to a successful career. 
3 0
2 years ago
Read 2 more answers
A while loop uses a(n) ___________ at the top of every iteration to test whether to continue or not.
Anni [7]

Answer:

boolean

Explanation:

while loops test to see if something is true or false to know when to continue the loop

8 0
2 years ago
What type of activities are performed with the help of the software used in hospitals?
faust18 [17]

Answer:

Xrays, Ultrasounds, managing patient records, communicating with colleagues, etc.

7 0
2 years ago
Read 2 more answers
Other questions:
  • Describe Mr. Digby, the principal. ​
    10·1 answer
  • The concept of ____ refers to the idea that the internet is designed for all content to be treated equally.
    12·1 answer
  • What describes the basic transaction data such as its date, purpose, and amount and includes cash receipts, canceled checks, inv
    13·1 answer
  • Which of the following is a typical concern for developers while using prototypes?
    6·2 answers
  • What is the function of the capsid? it allows a virus to live independently. it is composed of genetic material. it destroys the
    12·2 answers
  • What does the binary odometer show about representing large numbers?
    8·1 answer
  • Which of the following sentences is accurate? a. PDF stands for "Proofreading Direct Files." b. PDF files cannot be edited. c. B
    9·1 answer
  • White lines
    7·2 answers
  • Define a function compute gas volume that returns the volume of a gas given parameters pressure, temperature, and moles. Use the
    7·2 answers
  • How many of you got the right answer from this app​
    8·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!