A simple application for calculator change and average
Clone repository [email protected]:charleycesar/TrocoYii.git
and execute composer install
to install all dependencies.
execute ./vendor/bin/codecept run unit
to run all test suite
There has 2 features and solve 2 problem
Imagine that you work in the cashier of a supermarket. Whenever a customer arrives and pays your purchase, you must hand him the change in coins. You particularly like these coins, and want to deliver as few coins as possible to the customer.
For a value of N change how many currencies should you deliver to the customer so that the total currencies are the least possible?
For example, if you have an stock of money of NOTAS = {100,50,20,10,5,2,1}, and need a change for 328: [100=>3, 20=>1, 5=>1, 2=>2, 1=>1] with a total of 328.
Make a program that receives (read) n numbers, computes and Show (write) the arithmetic mean between them. For example, if you set three number the program need to get average. [10,7,7] Average is 8.