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
Investigate the many ways that hardware and software can cause an interrupt to occur. Are ALL interrupts treated equally or do s
slavikrds [6]

Answer:

Following are the responses to the given question:  

Explanation:

This list is based mostly on the processor. Then you'll be ordered. An interrupt of a particular cable (wire) is produced for PC-ish CPUs (IRQ 0 - 31 for some intel processors). The bigger challenge is a lower number.

Strange factors have included a system clock, power business, 0, some reserved for use by CPU testing, serial/parallel/... ports and also some terminated/error/state/new devices requests device Thus a key touch on the keyboards could create an interrupt that was direct on old devices.

3 0
2 years ago
A homeowner uses a smart assistant to set the house alarm, get packages delivery updates, and set time on the outdoor lights. Wh
ch4aika [34]

The example where the alarm of the house set up, delivery updated should be provided, etc should represent the function example of the artificial intelligence.

The following information related to artificial intelligence is:

  • It refers to the human intelligence where the machines could be treated as humans and according to this, the actions should be mimic.
  • It should be used for any kind of machine where the traits should be associated along with the mind of the human-like for learning & problem-solving purpose.

Therefore we can conclude that The example where the alarm of the house set up, delivery updated should be provided, etc should represent the function example of the artificial intelligence.

Learn more about the machine here: brainly.com/question/2555822

3 0
3 years ago
What are the steps involved in accepting all the changes in a document?
I am Lyosha [343]
  1. you can accept or reject the changes one at a time or all at one time.
  2. click at the beginning of the document , and then on the review tab, click next to go to the first tracked change.
  3. Click Accept or reject to keep or remove the change.

Keep repeating the step 2 until you've reviewed all of the changes in your document.

*Hope this helps !!! Mark me Brainliest :)

7 0
3 years ago
Read 2 more answers
Can someone help me on drawing ER and Use case diagram on following scenarios. ASAP!!! Please :(
GalinKa [24]

Answer:

The ER Diagram is in the attachment. And I an including the membership details in the use case:

Applicants: Coach will ask for iD.

if the application is not registered, coach sends to registration department.

Applicants registers-->> shows registration ID-->> goes to account section

Submits the fee->> goes to coach again-->>coach asks for fee sjip-->> On yes-->> entrance allowed else-->> sent to account section

Applicants apply for course-->>if prerequisite is met, registration allowed

else-->>registration denied

Note: If registration is allowed the applicant is sent to account section and

Also note:

First check, then registration, then course prerequisite check,then account->entrance

If registered->direct entry.

Explanation:

The answer is self explanatory.

4 0
3 years ago
Libraries can be found in cities of all sizes and are open to varied users.
Inessa [10]

Answer:

True

Explanation:

3 0
2 years ago
Read 2 more answers
Other questions:
  • Which social networking function came first?
    9·2 answers
  • A user found that their personal data had been exfiltrated from their computer by a malicious program that they clicked on sever
    12·1 answer
  • 99 points!!! What would happen to the document if the change “A” is pointing to was accepted? a. There would be no changes. b. “
    6·2 answers
  • This program will read integers from a file and find results from these integers. Open the file, test to make sure the file open
    12·1 answer
  • An extranet is a business or organization's intranet that is partially accessible to authorized people outside the business or o
    8·1 answer
  • _______ data would be useful for creating a weekly status report for your manager that should reflect changes in real time.     
    10·2 answers
  • What is human data,
    8·1 answer
  • STAY AWAY FROM AND REPORT mariaivanovaloveyou!!!!!!! SHE IS A BRAINLY USER AND KEEPS POSTING INAPPROPRIATE PICTURES OF HER BODY
    13·1 answer
  • I need to change the subject before they get onto me. I am only revealing info today if you are a friend.
    5·1 answer
  • The History feature of a browser enables you to retrace your browsing history over a short period of time. (1 point) True False
    9·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!