Hey Guys, Im new to learning java and I am writing a few programs for practice. I cant figure out whats wrong with my code. When i try to compile i get an "error . class expected" Any advice is appreciated, thank you.
import javax.swing.JOptionPane;
public class TuitionCost
{
public static void main(String [] args)
{
JOptionPane.showMessageDialog(null,"School Tuition Cost Calculation Program","Tuition Costs at School",JOptionPane.INFORMATION_MESSAGE);
String ResidencyInput = JOptionPane.showInputDialog("Are you a:" +
"\n1 - College District Resident" +
"\n2 - Non-resident of College District" +
"\n3 - Out-of-state or International Student" +
"\n\n Enter a 1,2, or 3:", JOptionPane.QUESTION_MESSAGE);
int Residency = Integer.parseInt(ResidencyInput);
if (Residency < 1 || Residency > 4)
JOptionPane.showMessageDialog(null,"\n\nYou must enter a 1,2, or 3" +
"\nPlease run the program again",
"ERROR! - INVALID INPUT", JOptionPane.WARNING_MESSAGE);
System.exit(0);
if (Residency == 1)
double CreditHour = 71.40;
else if (Residency == 2)
double CreditHour = 125.30;
}
}