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
Formulas should follow the___
tatuchka [14]

Answer:

Order of operations

Explanation:

4 0
2 years ago
After adding an image to her flyer, Danica played around to see which layout would look the best. At one point, her text was on
Norma-Jean [14]

Answer:

Position Feature

Wrap text feature

Picture tools

Explanation:

3 0
2 years ago
Read 2 more answers
In which area of the screen can features and functions of Word be accessed?
abruzzese [7]

Answer:

Toolbar

Explanation:

j don't know if you meant that instead of scroll bar, but tool bar is the answer

5 0
2 years ago
PLEASE HELP I'M TAKING A QUIZ AND I HAVE 5 MINUTES LEFT
larisa [96]

Answer:

pp popo

Explanation:

6 0
2 years ago
Read 2 more answers
Network services use to define a set of rules that govern how devices communicate and the data formats used in a network.
devlian [24]
The correct answer is protocols.
Protocols are rules and instructions as to how devices should function. Each of these devices has its own protocols about its inner workings that regulate how that particular device is going to work and function in real life. Without these protocols, the device wouldn't be able to work.
7 0
3 years ago
Other questions:
  • An employee is angry with his boss and wants to sabotage the company. To accomplish this he secretly changes some of the values
    7·1 answer
  • In what stage of writing does publishing occur
    14·1 answer
  • What udp port is used for i k e traffic from vpn client to server?
    14·1 answer
  • Plz tell me a storage device that should be used for this and why
    11·1 answer
  • The inside color of text or of an object is called the:
    12·1 answer
  • Add the following method to the Point class: public double distance(Point other) Returns the distance between the current Point
    12·1 answer
  • Kyle returns to work the next day and he would like to continue working on the document from yesterday. What should Kyle do?
    7·1 answer
  • How do you get lugia in pokemon alpha saphire
    6·1 answer
  • An information system can enhance core competencies by
    13·1 answer
  • How to be gud at Friday night funk
    11·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!