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
Nata [24]
3 years ago
11

4. 15 Exact change (College level not sure why it says middle school)

Computers and Technology
1 answer:
sweet [91]3 years ago
6 0

Answer:

def print_change(total_change):#this is also total cents, because integers don't have decimal points, so I can't use dollars as my unit

dollars = int(total_change / 100)

remaining_change = total_change - dollars * 100

quarters = int(remaining_change / 25)

remaining_change -= quarters * 25

dimes = int(remaining_change / 10)

remaining_change -= dimes * 10

nickels = int(remaining_change / 5)

remaining_change -= nickels * 5

pennies = remaining_change

all = {'dollar': dollars, 'quarter': quarters, 'dime': dimes, 'nickel': nickels, 'penny': pennies}

for num in [0, 1, 2, 3, 4]:

coin_type = list(all.keys())[num]

amount = all[coin_type]

if num < 4 and amount > 1 or amount == 0 and num < 4:

coin_type += 's'

elif num == 4 and amount > 1 or amount == 0 and num == 4:

coin_type = 'pennies'

print('\n', amount, coin_type)

while True:

total_change = int(input()) #in cents

print_change(total_change)

Had fun making this one... hope it helps. :)

You might be interested in
Research the disadvantages of the computer and explain them.​
lisabon 2012 [21]

Answer:

Too much sitting-affects the back and makes our muscles tight

Carpal tunnel and eye strain-moving your hand from your keyboard to a mouse and typing are all repetitive and can cause injuries

Short attention span and too much multitasking-As you use a computer and the Internet and get immediate answers to your questions and requests, you become accustomed to getting that quick dopamine fix. You can become easily frustrated when something doesn't work or is not answered in a timely matter.

3 0
3 years ago
what is the largest possible number of internal nodes in a redblack tree with black height k? what is the smallest possiblenumbe
Elina [12.6K]

Answer:

A Red Black Tree is a type of self-balancing(BST) in this tree ,each node is red or black colored. The red black tree meets all the properties of the binary search tree, but some additional properties have been added to a Red Black Tree.

A Red-Black tree's height is O(Logn) where (n is the tree's amount of nodes).

In a red-black tree with black height k

The maximum number of internal nodes is 2^{2k} -1.

The smallest possible number is 2^{k} -1.

7 0
2 years ago
During the troubleshooting of a pc that will not boot, it is suspected that the problem is with the ram modules. the ram modules
Damm [24]
The modules were somehow disconnected
8 0
3 years ago
I hate school...............
butalik [34]

Answer:

Check your email.

Explanation:

8 0
2 years ago
Read 2 more answers
Carlos has noticed that he has a duplicate slide in his presentation. He would like to delete it. He should _____.
vagabundo [1.1K]

Answer:

click on the slide in normal view and press delete

Explanation:

i don't know if this is right but you can click edit and delete it like that.

8 0
2 years ago
Other questions:
  • Computers with more than ____ of ram work with the aero interface in windows 7 as shown in the accompanying figure.
    15·1 answer
  • WILL UPVOTE NEED ANSWERS ASAP i have till 4:30
    12·1 answer
  • An iframe is an inline table for a website. True False i need an answer fast
    15·1 answer
  • Blank includes websites that encourage interaction and connection among people ,business and organizations
    13·1 answer
  • How to Save Power-Point presentation as a single file Web page that can be uploaded to the World Wide Web ?
    14·1 answer
  • Since the rules cannot address all circumstances, the Code includes a conceptual framework approach for members to use to evalua
    8·1 answer
  • Write a C# program named DoubleDecimalTest thatdeclares and displays two variables - a double and a decimal.Experiment by assign
    9·1 answer
  • Which term refers to a solution to a large problem that is based on the solutions of smaller subproblems. A. procedural abstract
    5·1 answer
  • What is the difference between a LAN and WAN? how do these two networks interact?​
    14·1 answer
  • Which programming language was released first? FORTRAN BASIC Perl Pascal<br><br>ANSWER: FORTRAN (A)
    9·2 answers
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!