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]
3 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]3 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
What statement best describes operating systems?
arlik [135]

Answer: D) Operating Systems manage the computer's random access memory (RAM)

Explanation:

It's not A because all modern computers use some form of an Operating System.

It's not B because some Operating Systems can cost hundreds of dollars.

While C has some truth to it, it's reversed. Operating Systems are there to manage and allocate system resources, and D is the better choice.

6 0
3 years ago
Modify your main.c file so that it allocates a two dimensional array of integers so that the array has 20 rows of 30 integers in
Alexandra [31]

Answer:

Explanation:

b

7 0
2 years ago
What layer of the OSI model describes how data between applications is synced and recovered if messages don't arrive intact at t
lina2011 [118]

Answer:

C) Session Layer.

Explanation:

OSI model stands for Open Systems Interconnection. The seven layers of OSI model architecture starts from the Hardware Layers (Layers in Hardware Systems) to Software Layers (Layers in Software Systems) and includes the following;

1. Physical Layer

2. Data link Layer

3. Network Layer

4. Transport Layer

5. Session Layer

6. Presentation Layer

7. Application Layer

Basically, each layer has its unique functionality which is responsible for the proper functioning of the communication services.

Session layer is the layer of an Open Systems Interconnection (OSI) model which describes how data between applications is synced and recovered if messages don't arrive intact at the receiving application.

3 0
2 years ago
Unscramble thr words <br>1.Nsieg Wiev<br>2.Seeathdat ievw​
valentinak56 [21]

Answer: genis view       headset view

Explanation:

6 0
2 years ago
Read 2 more answers
What does the shell of an operating system do
Andre45 [30]

The OS shell allows access to the operating system services

8 0
3 years ago
Other questions:
  • One of the most famous ___ licenses is gpl, which ensures that a particular program remains free to distribute and allows its co
    10·1 answer
  • 1. To type a capital "C", you would use the ring finger of your left hand.
    15·2 answers
  • The device used to connect a network to the internet is called a
    7·1 answer
  • Fill in the blank.
    7·1 answer
  • To print data sideways on a piece of paper, use the _______ page orientation setting.
    6·2 answers
  • (01.03 LC)
    9·1 answer
  • How does the teacher know you have completed your assignment in Google Classroom?
    12·1 answer
  • BEING TIMED HELP ASAP
    12·2 answers
  • Can somebody help me out
    15·1 answer
  • 8.11 LAB: Filter and sort a list
    8·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!