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]
2 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]2 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
Wendy is an attacker who recently gained access to a vulnerable web server running Microsoft Windows. What command can she use t
VikaD [51]

Answer:

I would say that if she is connected to the server and has grained access to the server, Wendy would have to use the command shortkey win+r (to run) or she could just use the "Type here to search" function.

Then you can type the words "cmd" to bring up the command prompt

Lastly, she would need to use the protocol scp to transfer files. Wendy might need to include a destination for the files to be directed to.

7 0
2 years ago
Mathematical computations by a computer are faster than your quickest mathematical computations because the top speed of a neura
Tema [17]

Answer:

3 million

Explanation:

According to my research on information technology, I can say that based on the information provided within the question the top speed of a neural impulse is about 3 million times slower than the speed of electricity through the wired circuitry in a computer. Neurons have been calculated as firing roughly 200 times per second, while a computer processing unit processes at about 600 million instructions per second.

I hope this answered your question. If you have any more questions feel free to ask away at Brainly.

6 0
3 years ago
If Asa changes the text to bold, he has changed the style. True False
LiRa [457]
True because if you were to bold a text, you have presented that the following text is more important or exemplified. 
4 0
3 years ago
Read 2 more answers
Consider a computer system, where each processor can independently perform a separate task. given that the response time on a co
vekshin1
First four tasks = 8 seconds
Next four tasks = 8 seconds
Last two tasks = 8 seconds

The total number of seconds to perform all tasks is 24 seconds.

The throughput, which would be the number of tasks per second, is calculated by taking the number of tasks and dividing by the number of seconds:

10 tasks / 24 seconds = 5/12 or 0.4167 tasks per second
8 0
3 years ago
Who is the father of computer?​
bagirrra123 [75]

Answer:

The first automatic digital computer has been designed by the English mathematician and inventor Charles Babbage. Babbage developed the Analytical Engine Plans for the mid-1830s.

Explanation:

  • Babbage has developed the concept of a digital, programmable computer and was a mathematician, philosopher, inventor, and mechanical engineer.
  • Some regard Babbage as a "computer father"
  • The inventing of its first mechanical computer, the difference engine, is attributable to Babbage, which eventually resulted in more complex electronic designs, although Babbage's Analytical Engine is the main source of ideas for modern computers. He was described as the "prime" among the numerous polymaths of his century by his varied work in another field.
7 0
2 years ago
Other questions:
  • Once you have selected the range of cells for your table data, from which tab can you open the Insert Table dialog box?
    6·2 answers
  • __________ is when a person feels compelled to acquire and abuse a drug despite the harm it causes him or her personally, and de
    7·2 answers
  • In evaluating the precedence rules used by Python, what statement is accurate? a. Addition and subtraction are evaluated after a
    8·2 answers
  • It will gain you more knowledge, intensify your soft skills, strong work ethics and grow your network. What is it?​
    12·2 answers
  • Translate the following C++ program to MIPS assembly program. *Please explain each instruction of your code by a comment and sub
    5·1 answer
  • Your task is to write and test a function which takes one argument (a year) and returns True if the year is a leap year, or Fals
    5·1 answer
  • as the new hr manager hired by a company to clean up some of the company's problems,analyse the system requirements for the comp
    14·1 answer
  • Refer to the method f: Public int f( int k, int n ) { if( n == k ) return k; else if( n > k ) return f( k, n - k ); else retu
    8·1 answer
  • Which finger is used to press SHIFT key while typing!
    14·2 answers
  • Would it be feasible to combine fixed length field and variable length field format in single disk
    15·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!