2. Your code is only missing the commands in between { and }, just put
print("higher");
in the first blank line and you're done with the first if block.
No "then" needed.
Here is an example for you:
http://javacodex.com/Flow-Control/High-L...
If(){
} else if () {
} else {
}
okay so my instructions are to make a program that genrates a random number and then you have make the program say either :higher" or "Lower" for each guess... They gave me the line of code for Random number, i just need to know how to do a "if" then statement. this is what i have so far
print("hello");
print("im thinking of a number between 1 and 100, guess it");
var randomNumber = Math.floor((Math.random() * 100) + 1);
var guess = readline ();
if (randomNumber > guess) {
}
if (randomNumber < guess) {
}
if (randomNumber == guess) {
}
I just figure out what foes in between the brackets.. It also has to loop forever until you guess the right number.
much thanks, Mark