Java code issues

shoob0x

Honorable
Dec 6, 2013
330
0
10,790
Hello, my code is

Java:
var speed = 65;

// Complete the condition in the ()s on line 4
if (speed <= 80) {
	// Use console.log() to print "Slow downc
console.log("Slow down")
} else {
	// Use console.log() to print "Drive safe"
console.log("Drive safe")
}
But it keeps prompting "Slow down" instead. Am I misinterpreting the <= and > part? Thanks in advance.

<code tags added by administrator>
 

Please read this http://www.tomshardware.com/forum/244553-49-read-programming-assignment-help before posting homework assignments. I've fixed your code this time, but next time please use the code tags.
 


So in Java < 8 means less than 8? Such an odd langauage. Thank you though.
 


Means the same thing in all languages. Even in math.
 
What's odd about < being less than? When you are doing something like x < 8, you are saying x is less than 8, just like if you were doing plain math. So if you have x = 20, and then make an if (x < 8) statement, the computer will evaluate if x is in fact less than (<) 8 in this example. 20 < 8 is false in the case, so the computer will skip to the next statement. The signs are exactly the same as they are used in mathematics.
 


Wait, dear god I'm tired xD thank you.
 


Yes xD forgive me, I'm quite tired.