I'm having trouble getting a for loop in my program to wrok. I'm not sure what I'm doing wrong. I've been working on it for about 3 hours and still have no clue what to do.
I fixed the while statement. That is not the problem. The problem is with the for loop towards the bottom of the code.
Here is my code:
while(!(strSelection=("5")))
{
strSelection=JOptionPane.showInputDialog(
null, "~~Please make a selection from the menu below~~"+
"\n\n1. Add a new advisee"+
"\n2. Update and advisee's information"+
"\n3. Display all advisees"+
"\n4. Display advisees who are cleared to graduate"+
"\n5. Exit"+
"\n\nWhat is your selection?", "Menu", 3);
switch(strSelection)
{
case "1":
String strString;
String strHours;
int iHours;
String strMajor;
boolean blnMajor;
String strIntent;
boolean blnIntent;
adv[iCount]=new Advisee();
adv[iCount].setName(JOptionPane.showInputDialog(null,"What is the advisee's name?","Name",3));
adv[iCount].setID(JOptionPane.showInputDialog(null,"What is the advisee's ID?","ID",3));
adv[iCount].setConcentration(JOptionPane.showInputDialog(null,"What is the advisee's concentration?","Concentration",3));
adv[iCount].setAdvisor(strAdvisor);
strHours=JOptionPane.showInputDialog(null,"What are the advisee's completed hours?","Completed Hours",3);
iHours=Integer.parseInt(strHours);
adv[iCount].setHoursCompleted(iHours);
strMajor=JOptionPane.showInputDialog(null,"Does the advisee have the major sheet?","Major Sheet",3);
blnMajor=Boolean.parseBoolean(strMajor);
adv[iCount].setMajorSheet(blnMajor);
strIntent=JOptionPane.showInputDialog(null,"Does the advisee have the intent to graduate form filed?","Intent To Graduate",3);
blnIntent=Boolean.parseBoolean(strIntent);
adv[iCount].setIntentFiled(blnIntent);
iCount++;
iAccum++;
break;
case "2":
String strUpdateSelection;
String strOutput="";
String strAccumulator="";
System.out.print(iAccum);
for(iCount=0;iCount==iAccum;iCount++)
{
strOutput=adv[iCount].getName();
strAccumulator+=strOutput;
}
strUpdateSelection=JOptionPane.showInputDialog(
null,"~~Please select which advisee's information you need to update~~"+
"\n"+strOutput+
"\nWhat is your selection?","Information Update",3);
break;
case "5":
System.exit(0);
break;
}
}
}
}