| about | help | code help+videos | done | prefs |
coffeeOrder
Goal: Determine the price of a coffee order based on size and extra options. Rules: Small coffee ("small") costs $3. Large coffee ("large") costs $5. If the customer wants whipped cream (hasWhip is true): Small coffee gets a $1 charge for whipped cream. Large coffee gets a $2 charge for whipped cream. Special rule: If it's "isHappyHour" (is true), whipped cream is free regardless of size. coffeeOrder("small", false, false) → 3 coffeeOrder("small", false, true) → 3 coffeeOrder("small", true, false) → 4 ...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: 200
Copyright Nick Parlante 2017 - privacy