## CCC '12 J1 - Speed fines are not fine!

View as PDF

Points: 3
Time limit: 2.0s
Memory limit: 64M

Problem type
Allowed languages
Ada, Assembly, Awk, Brain****, C, C#, C++, COBOL, CommonLisp, D, Dart, F#, Forth, Fortran, Go, Groovy, Haskell, Intercal, Java, JS, Kotlin, Lisp, Lua, Nim, ObjC, OCaml, Octave, Pascal, Perl, PHP, Pike, Prolog, Python, Racket, Ruby, Rust, Scala, Scheme, Sed, Swift, TCL, Text, Turing, VB, Zig
##### Canadian Computing Competition: 2012 Stage 1, Junior #1

Many communities now have "radar" signs that tell drivers what their speed is, in the hope that they will slow down.

You will output a message for a "radar" sign. The message will display information to a driver based on his/her speed according to the following table:

km/h over the limit Fine
1 to 20 $100 21 to 30$270

#### Sample Input 1

40
39

#### Sample Output 1

Congratulations, you are within the speed limit!

#### Sample Input 2

100
131

You are speeding and your fine is $500. #### Sample Input 3 100 120 #### Sample Output 3 You are speeding and your fine is$100.

• commented on Sept. 26, 2020, 4:11 p.m.

THE PERIODDD!!

• commented on Nov. 1, 2019, 10:39 a.m.

What does NameError mean? It doesnt state what it means in everywhere I've checked.

• commented on Nov. 1, 2019, 12:34 p.m.

It means there is an syntax error in python.

• commented on Feb. 8, 2018, 8:27 p.m.

Kms didn't see there was a period after the fine. There goes 5 min of my life.

• commented on July 26, 2020, 12:21 p.m.

thats why i just copy and paste what it has to print out an replace stuff like f

• commented on Oct. 21, 2017, 7:25 a.m. edited

this is a bit confusing in a weird way

• commented on May 5, 2016, 11:56 a.m. edited

I know this is a very simplistic way to approach this but why does this give me 10/50?

• commented on Oct. 25, 2019, 10:59 p.m. edited

Yeah same here. Tested code in netbeans ide and works fine. Could be something to do with the print out statements.

Edit: Nvm figured it out. I put a - instead of a = in the if statement.

• commented on May 5, 2016, 1:23 p.m.

Hi, welcome to DMOJ! Anyone who has solved a problem can see others' submissions, so there's no need to paste your code in a comment (and in fact, this is discouraged — it may spoil solutions!)

Regarding your issue, the judge expects output to be exact, and you're missing some punctuation. Good luck!