There are errors in lines : 9,14,28,47,,49,38 & 66 please can u give me solutions to these and thank for reading this.
CdRecord[] arrayrecord=new CdRecord[5];
int counter = 0;
int result;
CdRecord one = new CdRecord();
menu_choice=Integer.parseInt(JOptionPane.showInputDialog("Enter 1 to create cd"
+ "\nEnter 2 to print"
+ "\nEnter 3 to search"
+ "\nEnter 4 to quit" ));
while (menu_choice != 4)
{
if (menu_choice ==1 )
JOptionPane.showMessageDialog(null,"");
{
Record[counter] = new CdRecord();
counter++;
//for int (i)
}
if (menu_choice==2)
//JOptionPane.showMessageDialog(null,"");
{
for(int i=0;i<counter;i++)
Record[i].toString();
}
else if (menu_choice ==3)
//JOptionPane.showMessageDialog(null,"");
{
String searchKey =JOptionPane.showInputDialog("Please enter the model of the vehicle");
result=CdSearch(CdRecord,searchKey,counter);
if (result >= 0) // a valid array index
CdRecord[result].CdRecord();
else
JOptionPane.showMessageDialog(null,"KEY " + searchKey + " NOT FOUND");
}
menu_choice=Integer.parseInt(JOptionPane.showInputDialog("Enter 1 to create cd"
+ "\nEnter 2 to print"
+ "\nEnter 3 to search"
+ "\nEnter 4 to quit" ));
}
// System.out.println(one.toString());
}
public static int CdSearch (CdRecord [] data, String searchKey, int size)
{
for (int counter = 0; counter <size; counter++)
{
if (data[counter].toString().equals(searchKey))
return counter; // return position where found
}
return -1; // if drop off end of array, its not there
}
}