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
Emily wants to search online for cakes containing nuts. However, she wants to skip cakes that have raisins in them. Which option
Mandarinka [93]

Answer:

I believe the answer is C

Explanation:

6 0
3 years ago
if you love games played on facebook, such as farmville, what might be your motivation for playing games
castortr0y [4]

Plato users the answer is Social Interaction!

3 0
4 years ago
The ____ contains the computer's "brain," the central processing unit (CPU).
Vsevolod [243]
(not completely 100% sure) the Motherboard
6 0
4 years ago
Read 2 more answers
To change the print orientation from portrait to landscape, tap or click the ____ button on the print preview tab.
lianna [129]
<span>In certain instances, it makes sense to print documents in landscape orientation. Some examples include spreadsheets and tables, where the content within the document is wider than it is longer. If you print in portrait mode, it would cut off parts of the table or spreadsheet. In this case, you'll want to change the print settings to landscape. To change it to landscape, simply click the "landscape" button on the print preview tab.</span>
4 0
3 years ago
True false) keybord has two shift keys.​
deff fn [24]

Answer:

True, looking at 'em right now!

Explanation:

8 0
4 years ago
Other questions:
  • Type the correct answer in the box spell all words correctly
    8·1 answer
  • HELP PLEASE NOW ASAP BRAINLIEST
    13·2 answers
  • You will be administratively suspended if you have a breath or blood alcohol level of.... or above or refuse to submit to a chem
    12·1 answer
  • Charts are inserted into an excel spreadsheet using the commands in the charts group on the ____ tab on the ribbon.
    13·1 answer
  • A business wants to centralize its administrative tasks. At the same time, it wants the existing systems to manage and sustain t
    14·2 answers
  • Julio receives many emails from a healthcare site. He finds them useful, and he wants to save them all in a folder. How can he a
    12·1 answer
  • Which of the following protocols help IP in multicast service?
    9·2 answers
  • Which of the following statements tests if users walked 10,000 or more steps and ate fewer than 25 grams of sugar?
    9·1 answer
  • Electrical data suitable for transmission is called a(n)
    5·1 answer
  • How do you answer other peoples questions on Brainly? I know how to ask them but not answer hmm...
    13·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!