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 the correct syntax to take the first five characters from the cell and place to its right in cell A3?
olga nikolaevna [1]

Answer:

In cell A3 we type

=Right(A2,5)

Explanation:

The Right function in the Microsoft excel is placing the character or the string into the right position .Following are the syntax to using the right function in the excel sheet

=Right(cell name,num _of_character )

  • cell name-In this we have to specify the cell name
  • num_of_character -In this we have to specify the number of character we want the right of the cell name .

From the given question We have putting the string in the cell A2 and we have used the function in the cell A3 i.e

=Right(A2,5)

4 0
3 years ago
What is indirect program memory addressing? Explain the working of the following instructions?
Elanso [62]
  • Indirect main memory addressing is described as the method in which the variable's address is stored in a mind register and also a command is utilized to point towards the memory registers which hold the register.
  • Instruction is used to direct towards a register that displays the results of the variables.
  • The register, in turn, refers to that variable's address in simplistic words. As just a result, it is indeed considered a passive program, memory address.

The instructions operate as follows:

a)

JMP AX :

  • The JMP instruction is being used to execute an unconditional jump.
  • AX is indeed the label's name.
  • JMP AX codes are being used to transfer control of the flow program to the AX label.

b)

JMP LIST:

  • The JMP command can be used to execute an unconditional jump, JMP LIST[DX] is the label's name.  
  • The JMP LIST[DX] program is being used to transfer control of its flow programs to the specified section.
  • It is the segment to which the flow control is transmitted.

c)

JMP NEAR PTR[DI+3]: 

  • Unconditional jumps could be done with the JMP command as you'll see, the label is JMP NEAR PTR[DI+3].
  • It's being used to transmit flow control to a particular section, throughout this case [DI+3].
  • The close keyword indicates that perhaps the code segment would be in the line of code being nearby.

Learn more:

brainly.com/question/20320915

4 0
3 years ago
In your own words, explain what it means to “buy low, sell high.”
Georgia [21]

Answer:

Resell value should be high like buying a used car for a low price fixing it a bit and double your money.

Explanation:

7 0
3 years ago
Read 2 more answers
"In Windows, what two terms describe the active partition on an MBR drive, and the location where the Windows operating system i
Oxana [17]

Answer:

Boot partition and system partition

Explanation:

System partition is the primary partition that is used as the active boot partition,it saves boot files and all files that will be used.  System partition is also known as the system directory or root directory and is usually given the identifier "c"

Boot partition is the disk partition that holds the files for the operating system files Windows operating system (either XP, Vista, 7, 8, 8.1 or 10), it works with the system partition and tells the computer where to look when starting. It given the identifier of letter "D" or "E"

5 0
4 years ago
Read 2 more answers
You are giving a presentation on designing multimedia presentations. You will have access to compatible A/V equipment, and you k
Pachacha [2.7K]

The term visual aid is self-explanatory. Visual aids help to enhance the involvement of the audience and increase their interest in the presentation.

<u>Explanation:</u>

Various types of visual aids can be used to increase the efficiency of a presentation. Before a presentation starts, handouts should be distributed that contains information about the key points covered in the presentation.

The presentation can be made more engaging by adding more relevant images and even videos.

A whiteboard should be used to convey information about the presentation. If the presentation is about some product, then some samples and props should also be used and giving a demo trial will always be a plus.

6 0
4 years ago
Other questions:
  • Does technology get in the way of learning ?<br> Help Meh ! ♥ Some ideas :D
    14·2 answers
  • . What year did the USA host World Cup? Right answer 1994
    5·1 answer
  • Which tool is used to create an interactive web application?
    15·1 answer
  • 1. Which of the following is an example of music piracy? a
    10·1 answer
  • Vertebrates first arrived during the _________________.
    9·1 answer
  • A company that manufactures machine parts orders a new system that makes products at ten times the speed of the earlier machine.
    6·2 answers
  • Which of these is an aggregator?
    5·2 answers
  • To record your own audio, you must have _____.
    14·2 answers
  • A dietician wants you to write a program that will calculate the number of calories a person can lose by walking at a slow pace
    13·1 answer
  • A.
    11·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!