Calculate how much everyone has to pay when a discount was given
Go to file
Midgard 0a46f30e92 Add README 2019-03-14 20:11:12 +01:00
LICENSE Add license 2019-03-14 20:09:36 +01:00
README.md Add README 2019-03-14 20:11:12 +01:00
simprizza.py Add README 2019-03-14 20:11:12 +01:00

README.md

simprizza

$ ./simprizza.py
Reduction in cents: 1295

Price 1 in cents: 1295
  Amount of orders at this price: 3

Price 2 (empty to finish): 1495
  Amount of orders at this price: 1

Price 3 (empty to finish): 

----------------

You got a reduction of 24%

 # | Normal price | Reduction price
---|--------------|----------------
 3 | €      12.95 | €          9.84
 1 | €      14.95 | €         11.36
---|--------------|----------------
 4 | €      53.80 | €         40.88
           You paid €         40.85
This solution has a bonus of 3¢ for the courier.