| about | help | code help+videos | done | prefs |
speedingFine
Goal: Calculate the dollar amount of a traffic ticket based on speed and zone type. Rules: In a regular zone (isSchoolZone is false): Speed 1–10 mph over limit: $50 Speed 11+ mph over limit: $100 In a school zone (isSchoolZone is true): All fines double! (Speed 1–10 mph over = $100, 11+ mph over = $200). Special rule: If speed is not over the limit (0 or less mph over), the fine is $0 in all zones. speedingFine(-5, false) → 0 speedingFine(-5, true) → 0 speedingFine(0, false) → 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