CJCoding With Joseph
15free / daySign inCreate account

Speeding Fine

Read a driver's speed and the speed limit and print the penalty for how far over the limit they were: not over at all prints No fine, up to 10 over prints Fine: 100, up to 30 over prints Fine: 250, and more than 30 over prints Licence suspended. Input: two lines, the speed then the limit, each an integer, no prompts. Output: one line. Work out the excess first and test that single number in the chain.

Expected Output:

No fine

= newline. The output ends with a newline — print one after the last line.

Hints3 available
Topics:
If Statements
📥 Auto-Input:
50\n60\n
This input is automatically fed to your program's stdin
1
Tab to indent (Esc then Tab to move on) · Ctrl+Enter to run · Ctrl+Space to expand shortcuts (pr, inp, def)

Your Output

Run your code to see the output here...

Test Cases

Run your code to see test case results.