I am recieving a syntax error and I can't figure out why. I am in an intro to programming course so my knowledge is very limited. This is a project I have to do and the code I have so far. I just want to test it to see if I am on the right path, but I cant. Any help would be GREATLY appreciate so I can at least see what my next issue is going to be haha.
import java.util.*;
public class project2 {
public static void main(String[] args) {
Scanner in = new Scanner (System.in);
System.out.println("Welcome, I am thinking of a number between 1-100. Take a guess!");
System.out.print("Please enter your number: ");
int guess = in.nextInt();
Random r = new Random(101);
int counter = 0;
int totalcount = 6;
While (counter != totalcount) { // being told to insert ";" and I have no clue why
if ( guess < r) {
System.out.print("You guessed " + guess);
System.out.println("Too Low");
} else if ( guess > r) {
System.out.print("You guessed " + guess);
System.out.println("Too High");
} else ( guess = r ) {
System.out.print("You guessed " + guess);
System.out.println("YOU'RE PSYCHIC!");
}
counter++;
}
}
}