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]
4 years ago
11

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

Computers and Technology
1 answer:
sweet [91]4 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
Which shortcut key aligns to the center of a page
riadik2000 [5.3K]

Answer:

To make text centered, select and highlight the text first, then hold down Ctrl (the control key) on the keyboard and press E. To make text right aligned, select and highlight the text first, then hold down Ctrl (the control key) on the keyboard and then press R.

Explanation:

4 0
3 years ago
How to create database using access​
timurjin [86]

i think by using python

6 0
3 years ago
Which part of the website address is its top-level domain name?
mr Goodwill [35]
The top-level domain is usually .com, .org, .net, and many more.
4 0
3 years ago
Please give me some names of web pages designed as a hoax or to mislead purposely the reader for some aim.
Tems11 [23]
When ever u download something Add fly pops up so that could be one
6 0
4 years ago
A ________ is a family of devices and software designed by the manufacturer to work best together.
Alexxx [7]

technology ecosystem

5 0
3 years ago
Other questions:
  • Jason is a computer hardware engineer. His work involves assembling computers. What will Jason need to assemble a microcomputer
    11·2 answers
  • Can we change the format of a field (e.g. Number to Dollars).
    7·1 answer
  • Consider this program segment: int newNum = 0, temp; int num = k; // k is some predefined integer value 0 while (num &gt; 10) {
    9·1 answer
  • What's is the contribution of technology to the country?
    15·1 answer
  • A popular Voice over Internet Protocol (VoIP) service is ________.
    12·1 answer
  • You are doing research for a science project on current trends in nanotechnology. You do a web search for information that inclu
    10·1 answer
  • How do assembly language different from machine language?
    15·1 answer
  • Which of the following is NOT a semantic reason for using header tags
    7·1 answer
  • WHO WANTS TO PLAY AMONG US
    15·2 answers
  • PLEASE HELP ME FIX THIS CODE.
    10·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!