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
Jeff decides that he would pay as much as $3,000 for a new laptop computer. He buys the computer and realizes consumer surplus o
Lady_Fox [76]

Jeff pay $2,300 for his computer.

b. $2,300

<u>Explanation:</u>

Consumer surplus can be defined as the amount that the consumer is willing to pay for a product or a service. The word surplus is a synonym for something extra or excess. It corresponds to the extra benefit that the consumer gets while buying something which may be the result of some discount, sale, or negotiation.  

Jeff realizes a consumer surplus of $700 while purchasing a laptop of $3000. As the consumer surplus is $700,

the amount Jeff has paid for the laptop is: $3000 - $700

                                          : $2300

6 0
3 years ago
Complete the paragraph below.
tiny-mole [99]

Answer:

inject, update

Explanation:

Dependency injection is a concept in object-oriented programming that links or transfers the functionality of an independent class to a dependent class.

Assuming two classes, Vehicle and Bus are created, the Bus class inherits from the Vehicle. The Bus class is dependent on the Vehicle class and its instances create instances of the Vehicle object.

It is easier and faster to update the Bus class and other classes that inherit from the Vehicle class by updating only the Vehicle class.

3 0
3 years ago
What does API stand for
KIM [24]
Application Programming Interface.
8 0
3 years ago
Read 2 more answers
How is table data displayed when you convert a table to text?
Ber [7]

Answer:

The table data is displayed as it is when it is converted into the text. Only the borders of the table get vanished. The data is displayed in the form of rows and columns.

Explanation:

  • Microsoft word has a feature that it converts the table into text and vice versa.
  • This feature helps as sometimes the table does not attracts much as the text do.
  • So for converting the table into text we take following steps:
  1. Select the entire table.
  2. Go to Layout tab.
  3. Locate the Data group.
  4. Click on "Convert to text"

The table will be converted to simple text.

I hope it will help you!

5 0
3 years ago
A data analyst is working with a data frame named retail. It has separate columns for dollars (price_dollars) and cents (price_c
lesantik [10]

The code chunk that lets the analyst create the price column is;

unite(retail, “price”, price_dollars, price_cents, sep=”.”)

The code chunk unite(retail, “price”, price_dollars, price_cents, sep=”.”) is the one that will allow the analyst to create the price column.

The reason for that answer is that;

  • The unite() function would allow the analyst  to make the dollars and cents data to be combined into a single column.
  • Meanwhile, in the parentheses of the given function, the analyst will write the name of the data frame.
  • Next step for the analyst is to write the name of the new column in quotation marks.
  • Next step is the names of the two columns they want to combine.
  • Lastly, the argument sep=”.” will now place a decimal point between the dollars and cents data given in the price column.

Read more about programming at; brainly.com/question/15683939

8 0
3 years ago
Other questions:
  • Using caller id is part of which step in an effective time management plan
    10·1 answer
  • Sarah is creating and formatting a newsletter for her school. Which page layout rules should she consider when doing this?
    13·2 answers
  • Discuss trends in cellular data transmission speeds
    15·2 answers
  • This isn't a homework question but rather a technological problem. I connected my device to the motherboard but it will not dete
    5·2 answers
  • Which term refers to the blank areas surrounding a document page? *
    15·1 answer
  • You are given a 5-letter word (for example, abcde). Write a C-Program which outputs all possible unique 5 letter permutations of
    13·1 answer
  • Calculator and clocks are examples of -------------- in windows 7
    14·1 answer
  • is a measurement that quantifies how much information can be transmitted over the network. A. Memory B. DMZ C. Bandwidth D. Clou
    10·1 answer
  • Most effective way of closing email is<br>​
    7·2 answers
  • which of the following protocols allows hosts to exchange messages to indicate problems with packet delivery?
    14·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!