Java Error, cannot find symbol?... I'm a beginner. Help please?

I'm a total novice when it comes to java and programming. I'm not 100% done with this code but when i compile it, i only get 1 error that's really stressing me out. that error is

Admittest.java:9: error: cannot find symbol

examScore(scoreSAT);

^

symbol: variable scoreSAT

location: class Admittest

1 error

I spent 1 hour trying to figure this out but i just don't understand why...

Any help would be beyond fantastic thanks. Also, it'd be great if the code could stay in this format somewhat because I'm planning to add more.

Here's my code:

import java.util.*;

public class Admittest {

public static void main(String[] args) {

Scanner console = new Scanner(System.in);

applicantInformation1();

int chooseSATorACT = chooseSATorACT(console);

examScore(scoreSAT); //this is where the error is at!

}

public static void applicantInformation1() {

System.out.println("Information for applicant #1:");

}

public static int chooseSATorACT(Scanner console) {

System.out.print("do you have 1) SAT scores or 2) ACT scores?");

int choose = console.nextInt();

return choose;

}

public static double enterSATorACT(Scanner console, int choose) {

if (choose == 1) {

useSATscore(console);

} else {

System.out.println("ACT score. Finish this code later");

}

}

public static double useSATscore(Scanner console){

System.out.print("SAT math? ");

double math = console.nextDouble();

System.out.print("SAT critical reading? ");

double reading = console.nextDouble();

System.out.print("SAT writing? ");

double writing = console.nextDouble();

double scoreSAT = scoreCalcSAT(math, reading, writing);

return scoreSAT;

}

public static double examScore(double scoreSAT) {

System.out.println("exam score= "+ scoreSAT);

}

public static double scoreCalcSAT(double math, double reading, double writing) {

return (2 * math + reading + writing) /32;

2 Answers

Relevance
  • 7 years ago
    Favorite Answer

    That identifier:

    scoreSAT

    is declared in method

    public static double useSATscore(Scanner console)

    ...

    double scoreSAT = scoreCalcSAT(math, reading, writing);

    and is therefore local to that method.

  • Ben
    Lv 7
    7 years ago

    You have to refer to the method as Admittest.examScore so Java knows where to find the method.

Still have questions? Get your answers by asking now.