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
Lady bird [3.3K]
3 years ago
5

Suppose we wanted to make change for purchases and wanted to use the least number of coins possible. Here is a greedy algorithm:

for the change amount due, we always use the largest-face-value coin first. Assume we have only coins of quarters ($.25), twenties ($.20), and pennies ($.01). Assume the change is $.40: a. what would be the coins and their numbers obtained by the greedy algorithm above
Computers and Technology
1 answer:
love history [14]3 years ago
5 0

Answer:

Explanation:

The following code is a Python function that takes in the amount of change. Then it uses division and the modulo operator to calculate the number of coins that make up the changes, using the greatest coin values first.

import math

def amountOfCoins(change):

   print("Change: " + str(change))

   quarters = math.floor(change / 0.25)

   change = change % 0.25

   dimes = math.floor(change / 0.20)

   change = change % 0.20

   pennies = math.floor(change / 0.01)

   print("Quarters: " + str(quarters) + "\nDimes: " + str(dimes) + "\nPennies: " + str(pennies))

You might be interested in
_____ (without parity) means spreading the data among multiple (at least two) drives. Group of answer choices Parity
Llana [10]

Answer:

"Disk Striping" would be the right choice.

Explanation:

  • Disk stripping has become a methodology where certain numerous small external drives consist of a single massive disk. This same classification turns huge information into single blocks but instead disperses them over numerous different storage media.
  • Disk stripping retail outlets instead of every data unit through a single place and doesn't provide disk failure safeguards.
3 0
3 years ago
Arrays are described as immutable because they are two dimensional. are arranged sequentially. can be reordered. cannot be chang
fredd [130]

Answer:

Arrays are described as immutable because they cannot be changed once they are defined.  (D on Edge)

Explanation:

It's in the notes and I just took the test (2020)

5 0
4 years ago
Your boss has asked you to edit a document she just created. You want to be able to make suggestions to the document without dir
ycow [4]

Maybe fix the grammar first. Then give suggestions that are similar but not the same to what the boss wrote.

-hope this helped
4 0
4 years ago
Read 2 more answers
Suppose Host A wants to send a large file to Host B. The path from Host A to Host B has three links, of rates R1 = 500 kbps, R2
Vlad1618 [11]

Answer:

a) 500 Kbps  b) 64 sec  c) 320 sec

Explanation:

a) We define the throughput of a network, as the actual maximum transmission rate that the network is able to deliver, which in this case is equal to the lowest transmission rate of any of the links that the traffic must go through:

R1 =500 kbps

b) If the file size is given in bytes, and we have the throughput in bps, we need to convert to bits first, as follows:

4*10⁶ bytes * (8 bits/byte) = 32*10⁶ bits.

The time needed to transfer the file, will be given by the quotient between the file size and the throughput, as follows:

t = 32*10⁶ bits / 500*10³ bits/sec = 64 sec

c) If the transmission rate R2 is reduced to 100 kbps, R2 becomes the lowest transmission rate in the network, so it becomes the new throughput.

So, the time needed for the same file to be transferred to host B is as follows:

t=  32*10⁶ bits / 100*10³ bits/sec = 320 sec

6 0
3 years ago
Which technology enables afloat forces to communicate more securely and to operate in a more dispersed manner?
Afina-wow [57]
<span>UHF and HF technology enables afloat forces to communicate more securely and to operate in a more dispersed manner.
</span>UHF stands for Ultra High Frequency, while HF stands for <span>High Frequency .
</span>The UHF range of the radio spectrum is the band<span> extending from 300</span>MHz<span> to 3 GHz and </span>is extensively used for satellite<span>communication and broadcasting, in </span>cellular telephone<span> and paging systems, and by third-generation (</span>3G<span>) </span>wireless services.
5 0
3 years ago
Other questions:
  • Retail price data for n = 60 hard disk drives were recently reported in a computer magazine. Three variables were recorded for e
    13·1 answer
  • ​ A wire service is also known as a ____.
    7·1 answer
  • 1 what elements of composition are under your control in photoshop
    13·1 answer
  • Inside which command group will a user find the ability to configure Outlook rules used to organize a mailbox?
    10·1 answer
  • For this assignment, you will write a program that calculates gross and net revenue for a movie theater. Consider the following
    15·1 answer
  • If there is only a stop sign posted at a railroad
    9·1 answer
  • WILL GIVE MORE POINTS, PLEASE HELP!!!
    11·1 answer
  • 4. What are the things that a computer literate understands?name them
    5·2 answers
  • I want to do is speed test to do i go to for my computer
    11·1 answer
  • Which cpu type would most likely be found in a smartphone?.
    10·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!