-2

I am creating a version of jeopardy in Java and I just inputted the answer methods to their respective question methods and I get the "cannot find symbol" error in regards to my parameters. Can anyone help?

    public static void questions400opt1 ()
    {
      Random rndm = new Random();
      int randomQGenerator = 1 + rndm.nextInt(5);

     if(randomQGenerator == 1)
     {
       System.out.println("");
       System.out.println("QUESTION: chris pratt voices this character in the lego movie");
       answer400opt1q1(total, total2, total3);
     }
     else if(randomQGenerator == 2)
     {
       System.out.println("");
       System.out.println("QUESTION: anna and elsa are the main characters of this blockbuster film");
       answer400opt1q2(total, total2, total3);
     }


The actual answer400opt1q1 method looks like (snippet):

    public static void answer400opt1q1 (int total, int total2, int total3)
    {
      Scanner word = new Scanner(System.in);
      Scanner num = new Scanner(System.in);

      System.out.print("ANSWER:");
      String answer = word.nextLine();
      System.out.print("player, enter your buzzing number: ");
      int playerNumber = num.nextInt();

      if(playerNumber == 1)
      {
       if(answer.equalsIgnoreCase("emmett"))
       {
         total =+ 400;
         System.out.println("");
         System.out.println("correct!");
       }
       else if(!(answer.equalsIgnoreCase("emmett")))
       {
         total =- 400;
         System.out.println("");
         System.out.println("incorrect answer!");
      }
     }
lux
  • 1

1 Answers1

1

In questions400opt1() method, total, total2, and total3 are not declared variables. Declare them first before using.

Kevin Anderson
  • 4,568
  • 3
  • 13
  • 21
  • can you give me an example as to how to declare them? I'm a little unsure.. – lux Jan 22 '19 at 03:05
  • 1
    @lux: you're asking about most basic Java coding. Please consider reading a tutorial, any tutorial, about declaring and using variables. This site cannot substitute for your doing this as we're just not set up as tutors or mentors – Hovercraft Full Of Eels Jan 22 '19 at 03:07
  • @lux: You can find some of the best tutorials here: [The Really Big Index](http://docs.oracle.com/javase/tutorial/reallybigindex.html) – Hovercraft Full Of Eels Jan 22 '19 at 03:09