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

Write a program with total change amount as an integer input, and output the change using the fewest coins, one coin type per li

ne. The coin types are Dollars, Quarters, Dimes, Nickels, and Pennies. Use singular and plural coin names as appropriate, like 1 Penny vs. 2 Pennies.
If input is 0 or less, output is 'No Change'
For Example: Input: 45
Output:
1 Quarter
2 Dimes
input_val = int(input())
if input_val <= 0:
print('No change')
else:
num_dollars == input_val // 100
input_val %= 100
num_quarters == input_val // 25
input_val %= 25
num_dimes == input_val // 10
input_val %= 10
num_nickels == input_val // 5
input_val %= 5
num_pennies == input_val
if num_dollars > 1:
print('%d dollars' % num_dollars)
elif num_dollars ==1:
print('%d dollar' % num_dollars)
if num_quarters > 1:
print('%d quarters' % num_quarters)
elif num_quarters ==1:
print('%d quarter' % num_quarters)
if num_dimes >1:
print('%d dimes' % num_dimes)
elif num_dimes ==1:
print('%d dime' % num_dimes)
if num_nickels >1:
print('%d nickels' % num_nickels)
elif num_nickels ==1:
print('%d nickel' % num_nickels)
if num_pennies >1:
print('%d pennies' % num_pennies)
elif num_pennies ==1:
print('%d penny' % num_pennies)
Computers and Technology
1 answer:
bonufazy [111]3 years ago
5 0

Answer:

b ,/knlk

Explanation:

You might be interested in
What procedures are involved in saving a file for the first time
ratelena [41]
You must name the file and you must also choose where the file will be saved.

3 0
3 years ago
Insurance can help you:
Blababa [14]
No it can not .............
3 0
4 years ago
Intranet giving unlimited information <br><br>True<br><br>False​
leva [86]

Answer:

true

Explanation:

An intranet is a computer network for sharing information, collaboration tools, operational systems, and other computing services within an organization, usually to the exclusion of access by outsiders. ... Intranets can also be used to facilitate working in groups or via teleconferences.

7 0
3 years ago
What is related to Gamut in Adobe illustrator?
seropon [69]

Answer:

range of colors that a color device can be display or print.a color that may be displayed on your monitior in rgb may not be printable in the gamut of your cmyk printer

7 0
4 years ago
It is common for people to name directories as dir1, dir2, and so on. When there are ten or more directories, the operating syst
Vikki [24]

Answer:

Here the code is given as follows,

Explanation:

7 0
3 years ago
Other questions:
  • Write the definitions of two classes Day and Night. Both classes have no constructors, methods or instance variables. Note: For
    8·1 answer
  • A ___ is a node (or a device) that connects two different networks together and allows them to communicate.
    12·1 answer
  • A computer system has 9,850 processes and 172 of them were suspended while 276 of them were terminated. Explain why some of the
    12·1 answer
  • How many binary digits does a single hexadecimal digit represent?
    6·1 answer
  • Which of the following is true regarding a class and interface types? Group of answer choices You can convert from a class type
    9·1 answer
  • Pharming involves redirecting users to a fraudulent Web site even when the user has typed in the correct address in the Web brow
    7·1 answer
  • Macro photographs are what type of photographs? A. Close-up B. Telephoto C. Abstract D. All of the above
    14·1 answer
  • TOT al<br>Name TWO examples of these settings and utilities. (2)​
    12·1 answer
  • you are packing a mobile phone containing a lithium ion battery and you get a prompt on the screen to put a lithium ion label on
    13·1 answer
  • 10. Two technicians are discussing recycling specifications for refrigerant. Technician A says that refrigerant oil with 5,000 p
    9·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!