Create an algorithm for program

Assignment Help Data Structure & Algorithms
Reference no: EM133247074

Assignment:

Create an algorithm for the following program: Vending Machine Change

Items distributed by a vending machine cost from 5 cents to $1.00 each, but the vending machine accepts only a single dollar bill for each item.

Determine how to distribute change using the fewest number of quarters, dimes, nickels, and pennies for an item.

Examples:

  • If the user purchases an item that costs 55 cents, your vending machine will return 45 cents change as follows: 1 quarter, 2 dimes, 0 nickels, and 0 pennies.
  • If the user purchases an item that costs 6 cents, then your vending machine will return 94 cents change: 3 quarters, 1 dime, 1 nickel, and 4 pennies.

Your algorithm should be able to make make change for every possible amount of change from 5 cents to 99 cents. Simply giving examples like the two above which describe specific instances is not an algorithm.

An algorithm that describes how to make change for each cost from 5 cents to 99 cents (using 90+ "if" statements) also is not acceptable.

Reference no: EM133247074

Questions Cloud

Explain business decision-makers : Price is the amount that consumers will be willing to pay for a product?
Discuss the use of digital data in human research : Discuss the five guideline areas suggested for managing privacy issues in regard to the use of digital data in human research.
Explain the threatening gestures : On March 15, 2021, at 2:30 a.m., Sandra Sue was in her home in West Palm Beach, Florida, when she heard loud voices and music. Ms. Doe looked out her living roo
What are the objective indicators by which legal ownership : What are the objective indicators by which legal ownership of land is established? Does subjective expectation, hope, belief, or claim mean anything? How does s
Create an algorithm for program : Your algorithm should be able to make make change for every possible amount of change from 5 cents to 99 cents.
Discuss process and steps would take : You are the CEO if a cancer treatment center. You have just discovered that your billing contractor has been inappropriately submitting separate claims to Medic
Discuss the concept of mutual mistake : Discuss the concept of Mutual mistake and what happens when the parties to the contract make a mutual mistake.
War memorial containing a vehicle : A District of Columbia ordinance prohibits "the use of any vehicle in any form in a District of Columbia park." Does the ordinance apply to the following?
Upper-management role in a company : You want to start your own business or will be taking an upper-management role in a company you currently work for. There are numerous legal-related considerati

Reviews

Write a Review

Data Structure & Algorithms Questions & Answers

  Implement an open hash table

In this programming assignment you will implement an open hash table and compare the performance of four hash functions using various prime table sizes.

  Use a search tree to find the solution

Explain how will use a search tree to find the solution.

  How to access virtualised applications through unicore

How to access virtualised applications through UNICORE

  Recursive tree algorithms

Write a recursive function to determine if a binary tree is a binary search tree.

  Determine the mean salary as well as the number of salaries

Determine the mean salary as well as the number of salaries.

  Currency conversion development

Currency Conversion Development

  Cloud computing assignment

WSDL service that receives a request for a stock market quote and returns the quote

  Design a gui and implement tic tac toe game in java

Design a GUI and implement Tic Tac Toe game in java

  Recursive implementation of euclids algorithm

Write a recursive implementation of Euclid's algorithm for finding the greatest common divisor (GCD) of two integers

  Data structures for a single algorithm

Data structures for a single algorithm

  Write the selection sort algorithm

Write the selection sort algorithm

  Design of sample and hold amplifiers for 100 msps by using n

The report is divided into four main parts. The introduction about sample, hold amplifier and design, bootstrap switch design followed by simulation results.

Free Assignment Quote

Assured A++ Grade

Get guaranteed satisfaction & time on delivery in every assignment order you paid with us! We ensure premium quality solution document along with free turntin report!

All rights reserved! Copyrights ©2019-2020 ExpertsMind IT Educational Pvt Ltd