about | help | code help+videos | done | prefs |
There's a sale on monkeys at the zoo. Given the number of monkeys, this method returns the total cost of those monkeys. They are only $5 each and every monkey you buy after the first 10 monkeys only cost $4 each. If the customer asks for a negative number of monkey, the cost is zero dollars and one strange look. monkeySale(4) → 20 monkeySale(11) → 54 monkeySale(12) → 58 ...Save, Compile, Run (ctrl-enter) |
Progress graphs:
Your progress graph for this problem
Random user progress graph for this problem
Random Epic Progress Graph
Difficulty: 100
Copyright Nick Parlante 2017 - privacy