Why the declaration of x
variable does not work? It shows error : cannot find symbol
I am new to Java programming
public static void CompareMark() {
double x;
System.out.print("Enter mark: \n");
x = scan.nextDouble();
if (x >= 0 && x <= 100) {
if (x >= 0 && x <= 49)
System.out.println("Grade:F");
else if (x >= 50 && x <= 59)
System.out.println("Grade:C");
else if (x >= 60 && x <= 74)
System.out.println("Grade:B");
else
System.out.println("Grade:A");
} else
System.out.println("Invalid marks");
}