Objects + Tests = Magic

08_katapotter 08_katapotter

12.12.2016 Views

is empty => 0.0 Let discounts = {d ∈ Discount | d can be applied to b} discounts is empty => |books|b * PRICE Let candidates = { p ∈ R | d ∈ discounts, p = compute(b,d) } => min(candidates) Let local price = d applied to b Let remaining = clone of b without the books used in d => local price + compute(remaining)

Testing the cashier

Testing the cashier

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!