PHP Classes
elePHPant
Icontem

PHP Coins Change: Solve the coin change problem for a given amount

Recommend this page to a friend!
Stumble It! Stumble It! Bookmark in del.icio.us Bookmark in del.icio.us
  Info   View files Example   View files View files (3)   DownloadInstall with Composer Download .zip   Reputation   Support forum   Blog    
Last Updated Ratings Unique User Downloads Download Rankings  
2014-09-01 (10 months ago) RSS 2.0 feedNot yet rated by the usersTotal: 137 This week: 1All time: 7,781 This week: 1,131Up
Version License PHP version Categories  
coins-change 0.1GNU General Publi...5.0Algorithms, PHP 5, Finances
Description Author  

This class can solve the coin change problem for a given amount.

It can take a given change amount and computes the smallest number of a given set of available coins to make up the change amount.

The class may consider an infinite number of coins of each value or just a limited number of coins of each one.

Innovation Award  
PHP Programming Innovation award nominee
September 2014
Number 9


Prize: One book of choice by Packt
Vending machines usually need to give change for the amount the customer paid after subtracting the due amount for the goods the customer purchased.

This class implements an algorithm to compute the number of coins to make up a given change amount, considering the number of coins available for different types of coin.

Manuel Lemos
Picture of Michele Andreoli
Name: Michele Andreoli is available for providing paid consulting. Contact Michele Andreoli .
Classes: 7 packages by
Country: Italy Italy
Age: 29
All time rank: 61522 in Italy Italy
Week rank: 112 Up2 in Italy Italy Up
Innovation award
Innovation award
Nominee: 4x

  Files folder image Files  
File Role Description
Plain text file CoinsManager.class.php Class Main class for coin changer
Accessible without login Plain text file index.php Example Example of use
Accessible without login HTML file output.html Output Output sample

 Version Control Unique User Downloads Download Rankings  
 0%Total:137All time:7,781
 This week:1This week:1,131Up