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
FrozenT [24]
2 years ago
15

3. Write a program that prompts the user to input an integer that represents cents. The program will then calculate the smallest

combination of coins that the user has. For example, 27 cents is 1 quarter, 0 nickle, and 2 pennies. That is 27=1*25+0*5+2*1.
Computers and Technology
1 answer:
miss Akunina [59]2 years ago
6 0

Answer:

The program in Python is as follows:

cents = int(input("Cents: "))

qtr = int(cents/25)

cents = cents -qtr * 25

nkl = int(cents/5)

pny = cents -nkl * 5

print(qtr,"quarters,",nkl,"nickels,",pny,"pennies")

Explanation:

This gets input for cents

cents = int(input("Cents: "))

This calculates the quarters in cents

qtr = int(cents/25)

This gets the remaining cents

cents = cents -qtr * 25

This calculates the nickel in remaining cents

nkl = int(cents/5)

This calculates the pennies in remaining cents

pny = cents -nkl * 5

This prints the required output

print(qtr,"quarters,",nkl,"nickels,",pny,"pennies")

You might be interested in
A skier provides what in a landscape photograph of a mountain?
liraira [26]
I think it may be D but all of them sound pretty important to get the perfect photo.  I tried researching and each website told me different.<span />
7 0
2 years ago
Read 2 more answers
Jason wants to set up his Wi-Fi’s security. He cannot install a central server for authentication. However, he wants to use a pr
jolli1 [7]

Answer:

Answer = a ig

wpa. ig ig ig ig

4 0
3 years ago
I NEED HEP QUICK
avanturin [10]

Answer:

O = (C2+C3+C4+C5)-81

Explanation:

5 0
2 years ago
Computer science is a blank process
PSYCHO15rus [73]

i agree... its a interesting thing to learn, just like learning an actual new language.

4 0
2 years ago
Read 2 more answers
After the closing entries have been posted:
Nimfa-mama [501]
Closing entries are entries<span> made at the end of an accounting period to zero out all temporary accounts. The balances are transferred to permanent accounts. 
After the closing entries have been posted:
A. the temporary accounts are zeroed out
Revenues and expenses are transferred to the income Summary Account and then Income Summary is closed to Retained earnings.</span>
7 0
3 years ago
Other questions:
  • An example of an email client is:<br> A.)Yahoo<br> B.)Gmail<br> C.)Outlook<br> D.)All of the Above
    9·1 answer
  • Why is it important to minimize cable clutter in a rack?
    11·1 answer
  • Almost all application programs are designed to run with a specific platform. Group of answer choices True False
    15·1 answer
  • The purchase of one cup of coffee a day what's going to do
    15·2 answers
  • A(n) _____ is money paid for work.<br><br> A. raise <br> B. allowance<br> C. wage<br> D. grant
    14·2 answers
  • What is the name of the option in most presentation applications with which you can modify slide elements?
    7·2 answers
  • Answer any one: write a computer program:which you know.​
    6·1 answer
  • How do i delete cookies on a chromebook?
    8·1 answer
  • Which of the following is typiacally the last step of the mail merge process
    11·1 answer
  • Which is NOT true?<br> 9 + 4 = 17 - 4<br> 8 + 7 = 14 + 3<br> 11 = 19 - 8<br> 5 + 8 = 20 - 7
    9·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!