1 Replies - 306 Views - Last Post: 06 December 2012 - 06:50 PM Rate Topic: -----

#1 Macdon  Icon User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 4
  • Joined: 20-November 12

Error: can't find symbol

Posted 06 December 2012 - 05:06 PM

Hello, I am trying to figure out how to fix these 4 errors within this program so far. I am not asking for anyone to do my homework for me, instead, I just want to fix these 4 errors. They are shown below, along with the program:

C:\Users\Joe\Documents\Hw6.java:19: error: cannot find symbol
Questions question1 = new Questions("1. What is the capital city of England?", "A) New York", "B) Moscow", "C) London", "C");
^
symbol: class Questions
location: class Hw6
C:\Users\Joe\Documents\Hw6.java:19: error: cannot find symbol
Questions question1 = new Questions("1. What is the capital city of England?", "A) New York", "B) Moscow", "C) London", "C");
^
symbol: class Questions
location: class Hw6
C:\Users\Joe\Documents\Hw6.java:27: error: cannot find symbol
Player player = new Player(name);
^
symbol: class Player
location: class Hw6
C:\Users\Joe\Documents\Hw6.java:27: error: cannot find symbol
Player player = new Player(name);
^
symbol: class Player
location: class Hw6
4 errors

Tool completed with exit code 1

Could someone please enlighten me on how to fix these? Thank you :)


import java.util.Scanner;
public class Hw6
{

   public static void main(String  args[])
   {

		Scanner Scan = new Scanner(System.in);
		String name, playerAnswer;

      // To do: Display the welcome message "Welcome to the Trivia Game"

      // To do: Ask the player if he/she wants to play

      // To do: if yes

                // To do: create five questions object instances here, question1 object instance creation is given as an example

      		Questions question1 = new Questions("1.	What is the capital city of England?", "A)	New York", "B)/>	Moscow", "C)	London", "C");



               //creating the player object instance
                System.out.println("Please enter your name:");
                name = Scan.nextLine();

                Player player = new Player(name);




                // To do: present questions to the player, one at a time, get the player answers
                // if the player answer is correct, add one to the player total for each correct answer
                // question1 is given as an example

                question1.askQuestion();

                System.out.println("\n Please enter your answer: ");
		playerAnswer = Scan.nextLine();

                if(question1.checkAnswer(playerAnswer))
                player.addApoint();          // player object instance name is player in this case






                // To do: display the total points earned by the player




           //To do: else, display the message "Good bye!"




   }
}




Is This A Good Question/Topic? 0
  • +

Replies To: Error: can't find symbol

#2 Luckless  Icon User is offline

  • </luck>
  • member icon

Reputation: 293
  • View blog
  • Posts: 1,146
  • Joined: 31-August 09

Re: Error: can't find symbol

Posted 06 December 2012 - 06:50 PM

You don't have a Questions or Player class created.
Was This Post Helpful? 0
  • +
  • -

Page 1 of 1