我是一名大学计算机科学专业的学生,我似乎无法找出这段代码有什么问题。如果我能得到一些帮助,将不胜感激。尝试编译程序时出现一个错误,它是
Quiz4.java:27:错误:不是语句 Else(.
代码:
import java.util.Scanner;
public class Quiz4
{
public static void main(String [] args)
{
System.out.println(
"\nAuthor: Allen Watson \n" +
"Class: \tCSCI 1250-001 \n" +
"Date: \t09/18/2013 \n" +
"Lab: \tQuiz4 \n");
Scanner Keyboard = new Scanner(System.in);
String strBornState;
String strCurrentState;
System.out.print("\nWhat state were you born in:");
strBornState = Keyboard.nextLine();
System.out.print("\nWhat state do you currently live in:");
strCurrentState = Keyboard.nextLine();
if(strBornState.equalsIgnoreCase(strCurrentState))
System.out.print("\nYou live in the same state you were born in:" + strBornState);
else(
System.out.print("\nYou DO NOT live in the same state you were born in:" + strCurrentState));
System.out.print("\n You were born in:" + strBornState.toUpperCase());
System.out.print("\nYou live in:" + strCurrentState.toLowerCase());
}
}