Help.. again please
I need to know why my If/Else statement isn't working, here's the code:
import java.awt.*;
import hsa.Console;
import java.io.*;
publicclass SensTest
{
staticpublicvoid main (String [] args)throws IOException
{
Console c;
c =new Console ();
String answer;
PrintWriter output;
int score;
score = 0;
output =new PrintWriter (new FileWriter ("Senstest.txt"));
c.println("Hello, welcome to the Ottawa Senators test.");
c.println("The first question is (Drumroll please)... When was the last time the Ottawa Senators won the Stanley Cup?");
answer = c.readLine();
if (answer.equals("1927"));// An If/Else statement for the score of the question
{
c.println("Congratulations, you are right!");
score = score + 1;
c.println("your score is: " + score);
}
else
{
c.println("Uh oh, you're wrong!");
c.println("your score is: " + score);
}
}
}
Please help... it says "Unexpected symbol ignored"
P.S.: I've tryed the "if (answer =="1927");
" trick still didn't work... it's probably something so dumb.
Message was edited by:
Java_junior_1990

