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
Which of the following statements describe the benefits of a career in transportation, distribution, and logistics (TDL)?
SVETLANKA909090 [29]

The statement that describes the benefits of a career in transportation, distribution, and logistics (TDL) is:

  • It seeks to reduce logistics costs for the company and increase satisfaction for buyers.

<h3>What is a career in transportation, distribution, and logistics (TDL)?</h3>

It is that career that evaluates what is relevant to logistics transport, that is, it ensures that the merchandise reaches the consumer in the right place and time, taking into account distribution and logistics.

<h3>Benefits of a career in transportation, distribution, and logistics (TDL)</h3>

  • It determines the efficiency of the company, being the key the optimization of the TDL and turning it into a competitive advantage to better position itself in the market.

  • Promote consumer satisfaction and confidence through an optimal logistics transport service.

Therefore, we can conclude that the a career in transportation, distribution, and logistics (TDL) helps the company to gain consumer trust.

Learn more about Transportation, distribution, and logistics here: brainly.com/question/25474654

6 0
3 years ago
Complete main() to read dates from input, one date per line. Each date's format must be as follows: March 1, 1990. Any date not
Airida [17]

Answer:

Explanation:

The following code uses the requested method and while loop in order to continue asking the user for inputs until the -1 input is passed and the program ends, outputting the correct format dates. Due to technical difficulties I had to add the code as a txt file attached below. The picture below shows the output of the code as requested using the test inputs provided.

Download txt
<span class="sg-text sg-text--link sg-text--bold sg-text--link-disabled sg-text--blue-dark"> txt </span>
ec9086bcbf2547784f036fbb9d68eba1.jpg
3 0
3 years ago
Suppose a developer gets class XYZ files and documentation from a subcontractor. This class does not implement the Comparable in
NNADVOKAT [17]

Answer:

A) The developer must supply a comparator object belonging to a class that implements the Comparator interface

Explanation:

The comparator interface handles the ordering (sorting) of user-defined classes, it does this by comparing two different objects from different classes. The comparator interface works by accepting a method which extracts a key for sorting of a type say N, and returns a comparator that compares to N, it therefore compares the object (current one) with the specified one

6 0
3 years ago
Easy<br> What is your favorite Anime<br> Mine is Attack On Titan at the moment
zhenek [66]

Answer:

I am currently watching Hunter x Hunter, so I quite like that. But my favorite is Moriarty the Patriot.

Explanation:

7 0
3 years ago
Read 2 more answers
How to stay organized in an online school?
Nitella [24]
To stay organized on an online school is no cursing. and keep your files clean and organized
4 0
3 years ago
Other questions:
  • HURRY!! Ill give brainily and 25 points. Describe how Scent is related to the culture and historical period when it was created.
    15·1 answer
  • Write a program that takes the radius of a sphere (a floating-point number) as input and then outputs the sphere’s: Diameter (2
    7·1 answer
  • A(n) __________ item is a hardware or software item that is to be modified and revised throughout its life cycle.
    6·2 answers
  • Which is true about POP3 and IMAP for incoming email?
    13·1 answer
  • Why do people still use Intel HD graphics for gaming?
    8·1 answer
  • BEING TIMED HELP ASAP
    12·2 answers
  • How much does a dodge tomohawk cost for a used one?
    7·1 answer
  • Difference between automated testing and manual testing
    13·1 answer
  • CSCU EXAM TEST FINAL1-A software or hardware that checks information coming from the Internet and depending on the applied confi
    6·1 answer
  • How will you maintain electrical tools and equipment?
    12·2 answers
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!