PHP Classes
elePHPant
Icontem

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

Recommend this page to a friend!
  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 (2 years ago) RSS 2.0 feedNot yet rated by the usersTotal: 171 All time: 8,037 This week: 1,109Up
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
  Performance   Level  
Name: Michele Andreoli <contact>
Classes: 7 packages by
Country: Italy Italy
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:171
This week:0
All time:8,037
This week:1,109Up