if (choice == 'n'){
response = JOptionPane.showInputDialog(null, promptName);
while ( response != null && response.length() > 0){
System.out.println("You are searching for " + response);
for (int i = 0; i < modelName.length; i++)
{
if (modelName[i] == response){
System.out.println( modelName[i] + "\t\t" + digitStockNumber[i] + "\t" + modelColor[i] + "\t" + integerPrice[i] );
}
}
response = JOptionPane.showInputDialog(null, promptName);
}
}
am i using arrays correctly or am i way off? The way im thinking it should run the for loop and test the modelName[i] and if it is == to response(name of vehicle user input) it will then display that line.
2007-07-15
16:17:42
·
1 answers
·
asked by
Anonymous
in
Computers & Internet
➔ Programming & Design