import java.util.*; import javax.swing.*; public class Schedule { public static void main(String[] args) { String[] classSchedule = {"CIS 110", "ENG 111", "MAT 070","WEB 110"}; String myClass; int x; boolean classExists = false; myClass = JOptionPane.showInputDialog(null, "Enter a class"); for(x = 0; x < classSchedule.length; ++x) if(myClass.equals(classSchedule[x])) classExists = true; if(classExists) JOptionPane.showMessageDialog(null, myClass + " exists"); else JOptionPane.showMessageDialog(null, myClass + " does not exist"); } }
basically I take this code here, try to implement a second dimension in the array, and suddenly none of the classes esist