Numerous 'else' without 'if' errors. HELP!!
im pretty new to java so any thoughts as to why I keep getting this error would be greatly appreciated.
__________________________________________________ _______________
Code:
import javax.swing.*;
public class Pets{
public static void main (String[] args){
int residence, hoursHome;
residence = Integer.parseInt(JOptionPane.showInputDialog("PLEASE INDICATE WHICH TYPE OF RESIDENCE YOU LIVE IN.\n" + "Enter an integer from 1 to 3 where:\n" + "1 = Apartment\n" + "2 = House\n" + "3 = Dormitory"));
hoursHome = Integer.parseInt(JOptionPane.showInputDialog("PLEASE INDICATE HOW MANY HOURS YOU ARE HOME.\n" + "Enter an integer from 1 to 5 where:\n" + "1 = 18 or more hours\n" + "2 = 17 to 10 hours\n" + "3 = 9 to 8 hours\n" + "4 = 7 to 6 hours\n" + "5 = 5 to zero hours"));
switch (residence){
case 1:
if(hoursHome == 1 || hoursHome ==2);
{JOptionPane.showMessageDialog(null, "You have indicated you live in an Apartment and are home 10 or more hours.\n" + "The recommended pet is a Cat.");}
else if(hoursHome == 3 || hoursHome == 4);
{JOptionPane.showMessageDialog(null, "You have indicated you live in an Apartment and are home less than 10 hours.\n" + "The recommended pet is a Hamster.");}
else{JOptionPane.showMessageDialog(null, "You have indicated you live in an Apartment and are home less than 10 hours.\n" + "The recommended pet is a Hamster.");}
break;
case 2:
if (hoursHome == 1);
{JOptionPane.showMessageDialog(null, "You have indicated you live in a House and are home 18 or more hours.\n" + "The recommended pet is a Pot-bellied Pig.");}
else if(hoursHome == 2);
{JOptionPane.showMessageDialog(null, "You have indicated you live in a House and are home 17 to 10 hours.\n" + "The recommended pet is a Dog.");}
else if(hoursHome == 3 || hoursHome == 4);
{JOptionPane.showMessageDialog(null, "You have indicated you live in a House and are home less than 10 hours.\n" +"The recommended pet is a Snake.");}
else{JOptionPane.showMessageDialog(null, "You have indicated you live in a House and are home less than 10 hours.\n" + "The recommended pet is a Snake.");}
break;
case 3:
if(hoursHome == 1 || hoursHome ==2);
{JOptionPane.showMessageDialog(null, "You have indicated you live in a Dormitory and are home 6 or more hours.\n" + "The recommended pet is a Fish.");}
else if (hoursHome == 3 || hoursHome ==4);
{JOptionPane.showMessageDialog(null, "You have indicated you live in a Dormitory and are home 6 or more hours.\n" + "The recommended pet is a Fish.");}
else{JOptionPane.showMessageDialog(null, "You have indicated you live in a Dormitory and are home less than 6 hours.\n" + "The recommended pet is an Ant Farm.");}
break;
default: {JOptionPane.showMessageDialog(null, "You have entered an illegal integer.");}
}
System.exit(0);
}
}