| about | help | code help+videos | done | prefs |
busFare
Goal: Determine public transit fare based on rider category and travel time. Rules: During peak hours (isPeak is true): Standard adult fare is $4. Seniors (isSenior is true) get a discounted fare of $2. During off-peak hours (isPeak is false): Standard adult fare is $2. Seniors ride for free ($0). Special rule: Children under 5 (isChild is true) ride for free ($0) at all times, regardless of peak status. busFare(false, false, true) → 0 busFare(true, false, true) → 0 busFare(false, true, true) → 0 ...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