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
What is a recent technological breakthrough with an impact that can be compared to the invention of paper nearly 2,000 years ago
Evgesh-ka [11]
<span>Electronic communication</span>
3 0
3 years ago
Digital subscriber lines: are very-high-speed data lines typically leased from long-distance telephone companies. are assigned t
V125BC [204]

Answer: Operate over existing telephone lines to carry voice, data, and video.

Explanation:

Digital subscriber line is a means of transferring high bandwidth data over a telephone line. Such data could be a voice call, graphics or video conferencing. DSL uses a user's existing land lines in a subscriber's home, allowing users to talk on a telephone line while also being connected to the Internet. In most cases, the DSL speed is a function of the distance between a user and a central station. The closer the station, the better its connectivity.

5 0
3 years ago
7.12 LAB: Even/odd values in a list
Korvikt [17]

The odd values in a list can be calculated by knowing the first and last number, whereas even numbers can be divided by two and the remainder is zero (0).

<h3>What are even numbers and odd numbers?</h3>

The even numbers can be found in a list because they are divisible by two and the remainder of this equation is always zero (0).

Conversely, odd numbers are those that cannot be divided exactly into exact entire numbers (e.g., 3, 5, etc).

The odd numbers in a list can be calculated by the equation ON (odd numbers): n/2 × [f + g], where 'f' is the first number and 'g' is the last number.

In conclusion, the odd values in a list can be calculated by knowing the first and last number, whereas even numbers can be divided by two and the remainder is 0.

Learn more about odd numbers here:

brainly.com/question/2263958

#SPJ1

4 0
2 years ago
For python how do I ask the user how many numbers they want to enter and then at the ending add those numbers up together?
Digiron [165]

I am not too familiar with the Python language, but the algorithm would be something like this:

1. create a variable for the sums of the number

2. read in how many numbers the user wants to enter (let's call it N)

and then create a for loop:

for N times

read in the next number

increase the sum variable by that number

Hopefully this helps!

8 0
3 years ago
Write a set of directions that tells an operating system’s dispatcher what to do when a process time slice is over.
tatyana61 [14]
<span> Directions that tells an operating system's dispatcher what to do when a process's time slice is over.Wait for the interrupt handler to be execute. Allow the scheduler to update the process table. Select the process form the process table that has the highest priority, restart the time, and allow the selected process to begin its time slice. Directions that tells an operating system's dispatcher what to do when a process's time slice is over. Signal an interrupt, save the current position, execute the current position, execute the interrupt handler, and switch to the next process until the process or processes is complete. If a process executes an I/O request, the time slice of that process will be terminated because it would waste the remaining time waiting for the controller to perform the request. A situation in a time-sharing system in which a process does not consume the entire time slice allotted to it. Client/server model Defines the basic roles played by the processes as being that of either a client, which makes requests of other processes Components of the email address </span>
6 0
3 years ago
Read 2 more answers
Other questions:
  • True or false? It is just too challenging to have different password for every
    12·1 answer
  • True or false: a cover letter accompanies a resume to showcase a job-seeker’s personal life
    6·2 answers
  • Does anybody know if that apple watch is actually worth what it costs?
    9·2 answers
  • Give two separate print statements: one will print your name, the other will print your major. Ensure that both will print on th
    15·1 answer
  • A user calls you and says that when they try to connect to the internal website, they are prompted for authentication. The user
    14·1 answer
  • To save a presentation, tap or click the save button on the Blank
    8·1 answer
  • An organization is developing an authentication service for use at the entry and exit ports of country borders. The service will
    10·1 answer
  • How do Computer Scientists use Binary Code?
    14·1 answer
  • A term to describe articles that can be displayed in their entirety,as opposed to abstract and references only
    11·1 answer
  • Which of the following is not a benefit of introducing an e-commerce solution to an organisation?
    14·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!