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 is/are the goal/s of Business Intelligence systems?
8_murik_8 [283]

Answer: Business intelligence system is a system that is used in the field of business and organizations for generations of the strategy and plans to make decision. This system consist of the business intelligence(BI) tools. It creates a connection in the different information/data and takes them to the business organization.

Business intelligence system has goals like:-

  • Increasing daily sales
  • Fast the growth rate of the business
  • improving the rental performance
  • Gaining more profit

5 0
3 years ago
Which is the best information to determine an athlete's abilities and needed areas of improvement?
katen-ka-za [31]

Answer:

4

Explanation:

7 0
3 years ago
Read 2 more answers
Guis, x-windows, suntools, and nextstep are built on top of what operating system?
iVinArrow [24]
Unix. GUIs were first shown at Xerox PARC (Palo Alto Research Center) in 1973. X-Windows is used on Unix to decouple I/O from processing, in other words what you're working on can be displaying on your computer but executing on another. NeXTstep is Apple's Unix developed on/from/with BSD (Berkley Software Division) Unix. I would assume that suntools were developed on Sun Solaris.
8 0
3 years ago
Some one please tell me how to change my name on here?
levacccp [35]

Answer:

I have no idea I need points though

6 0
3 years ago
The ____ web is a predicted evolution of the current web in which all web content is stored as if it were data in a database so
erica [24]
It might be the dark web I don't really know the context so yeah 



3 0
4 years ago
Read 2 more answers
Other questions:
  • . What are the disadvantages of using small, fixed-length cells in ATM?
    13·2 answers
  • A ____ is approximately a billion bytes.
    9·1 answer
  • Pls help brainliest
    12·1 answer
  • THE bestValue PROBLEM Using the Camera structure defined in file p1.cpp, write the function named bestValue(). The function take
    13·1 answer
  • Create a program that compares the unit prices for two sizes of laundry detergent sold at a grocery store.
    14·1 answer
  • The statement x++;
    11·1 answer
  • What will the following segment of code output if 11 is entered at the keyboard?
    12·1 answer
  • What was used to enhance silent films of the early 1900s
    15·1 answer
  • Im drinking coffee. and working on school and watching a show. Whos with me?
    9·1 answer
  • 9.3 code practice
    7·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!