Switch branches/tags
Nothing to show
Find file Copy path
Fetching contributors…
Cannot retrieve contributors at this time
36 lines (24 sloc) 1.05 KB
module Y2017.M05.D01.Exercise where
From the Mensa Genius Quiz-a-Day book by Dr. Abbie F. Salny, etc.
It's hard to keep within a budget, ...
... [let that sink in] ...
Maura discovered as she prepared her class's May Day party. She had been
assigned money from the common fund, and she spent half of it plus $2.00 for a
nice cake. Then she spent half of what she had left plus $2.00 for a baskets and
flowers. Then she spent half of what she had left plus $1.00 for candy. At that
point she was out of money. How much had she started with?
Side question: what was hard about keeping within the budget if, as this problem
states, Maura kept within the budget?
Assumption: she spent whole dollars on each purchase.
type Funds = Int
costofcake, basketsFlowers, candy :: Funds -> Funds
costofcake = undefined
basketsFlowers = undefined
candy = undefined
-- Side question: was the cake a lie? Did Maura eat the cake she bought?
-- was it delicious? Was there a candle, or no?
-- given the above, what was Maura's budget?
budget :: [Funds]
budget = undefined