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", "
^
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", "
^
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!"
}
}

New Topic/Question
Reply



MultiQuote



|