tracks/php/exercises/book-store/README.md in trackler-2.2.1.103 vs tracks/php/exercises/book-store/README.md in trackler-2.2.1.104

- old
+ new

@@ -1,24 +1,24 @@ # Book Store To try and encourage more sales of different books from a popular 5 book series, a bookshop has decided to offer discounts on multiple book purchases. -One copy of any of the five books costs $8. +One copy of any of the five books costs $8. If, however, you buy two different books, you get a 5% discount on those two books. -If you buy 3 different books, you get a 10% discount. +If you buy 3 different books, you get a 10% discount. If you buy 4 different books, you get a 20% discount. -If you buy all 5, you get a 25% discount. +If you buy all 5, you get a 25% discount. Note: that if you buy four books, of which 3 are different titles, you get a 10% discount on the 3 that -form part of a set, but the fourth book still costs $8. +form part of a set, but the fourth book still costs $8. Your mission is to write a piece of code to calculate the price of any conceivable shopping basket (containing only books of the same series), giving as big a discount as possible. @@ -28,11 +28,11 @@ - 2 copies of the first book - 2 copies of the second book - 2 copies of the third book - 1 copy of the fourth book - 1 copy of the fifth book - + One way of grouping these 8 books is: - 1 group of 5 --> 25% discount (1st,2nd,3rd,4th,5th) - +1 group of 3 --> 10% discount (1st,2nd,3rd) @@ -65,19 +65,25 @@ For a total of $51.20 And $51.20 is the price with the biggest discount. -## Making the Test Suite Pass -1. Get [PHPUnit]. +## Running the tests +1. Go to the root of your PHP exercise directory, which is `<EXERCISM_WORKSPACE>/php`. + To find the Exercism workspace run + + % exercism debug | grep Workspace + +1. Get [PHPUnit] if you don't have it already. + % wget --no-check-certificate https://phar.phpunit.de/phpunit.phar % chmod +x phpunit.phar -2. Execute the tests for an assignment. +2. Execute the tests: - % phpunit.phar wordy/wordy_test.php + % ./phpunit.phar book-store/book-store_test.php [PHPUnit]: http://phpunit.de ## Source