I need to write a program that reads this from the text file
and puts it in a few arrays
grade
FirstName
LastName
Gpa
the program also needs a capability to search those arrays
// Search by first name
// Search by last name
// Search by Gpa
and to provide an overall Gpa average
and it needs to have a capabilty to add new students
please help
I already have the menu
[CODE=java]public void menu()
{
char ch=30;
char ch1=31;
int l;
for(int i=0;i<27;i++)
{
System.out.prin t(" ");
}
for(l=0;l<2;l++ )
{
for(int j=0;j<38;j++)
{
System.out.prin t(ch);
}
System.out.prin tln("");
for(int k=0;k<27;k++)
{
System.out.prin t(" ");
}
}
System.out.prin t(ch);
System.out.prin t(ch1);
for(int i=0;i<34;i++)
System.out.prin t(" ");
System.out.prin t(ch);
System.out.prin t(ch1);
System.out.prin tln("");
for(int i=0;i<27;i++)
System.out.prin t(" ");
System.out.prin t(ch);
System.out.prin t(ch1+" ");
System.out.prin t (" 1. Enter new Students record ");
System.out.prin t(" "+ch);
System.out.prin tln(ch1+" ");
for(int i=0;i<26;i++)
System.out.prin t(" ");
System.out.prin t(" "+ch1);
System.out.prin t(ch+" ");
System.out.prin t (" 2. Display All Student records and GPA: ");
System.out.prin t(" "+ch);
System.out.prin tln(ch1+" ");
for(int i=0;i<26;i++)
System.out.prin t(" ");
System.out.prin t(" "+ch);
System.out.prin t(ch1+" ");
System.out.prin t (" 3. Search students by first name: ");
System.out.prin t(" "+ch);
System.out.prin tln(ch1+" ");
for(int i=0;i<26;i++)
System.out.prin t(" ");
System.out.prin t(" "+ch);
System.out.prin t(ch1+" ");
System.out.prin t (" 4. Search students by last name: ");
System.out.prin t(" "+ch);
System.out.prin tln(ch1+" ");
for(int i=0;i<26;i++)
System.out.prin t(" ");
System.out.prin t(" "+ch);
System.out.prin t(ch1+" ");
System.out.prin t (" 5. Search searchstudents by GPA:");
System.out.prin t(" "+ch);
System.out.prin tln(ch1+" ");
for(int i=0;i<26;i++)
System.out.prin t(" ");
System.out.prin t(" "+ch);
System.out.prin t(ch1+" ");
System.out .print(" 6. Replace Student Record: ");
System.out.prin t(" "+ch);
System.out.prin tln(ch1+" ");
for(int i=0;i<26;i++)
System.out.prin t(" ");
System.out.prin t(" "+ch);
System.out.prin t(ch1+" ");
System.out .print(" 7. Delete Record: ");
System.out.prin t(" "+ch);
System.out.prin tln(ch1+" ");
for(int i=0;i<26;i++)
System.out.prin t(" ");
System.out.prin t(" "+ch);
System.out.prin t(ch1+" ");
System.out .print(" 8. Exit: ");
System.out.prin t(" "+ch);
System.out.prin tln(ch1+" ");
for(int j=0;j<27;j++)
System.out.prin t(" ");
System.out.prin t(ch);
System.out.prin t(ch1);
for(int i=0;i<34;i++)
System.out.prin t(" ");
System.out.prin t(ch);
System.out.prin t(ch1);
System.out.prin tln("");
for(int i=0;i<27;i++)
System.out.prin t(" ");
for(int i=0;i<38;i++)
System.out.prin t(ch);
System.out.prin tln("");
for(int i=0;i<27;i++)
System.out.prin t(" ");
for(int i=0;i<38;i++)
System.out.prin t(ch);
//Scanner input = new Scanner ( System.in);
//int s;
int choice=0;
String strChoice = JOptionPane.sho wInputDialog(nu ll,"Pick your action");
choice = Integer.parseIn t(strChoice);
//s=new input.nextInt() ;
// SimpleComparato r(int s) {
switch (choice) {
case 1:
new_student();
break;
case 2:
display_allstud ents();
dispay_gpa_aver age
break;
case 3:
search_by_first _name();
break;
case 4:
search_by_last_ name();
break;
case 5:
search_by_gpa() ;
break;
case 6:
replace_record( );
break;
case 7:
delete_record() ;
break;
case 8:
break;
default:
break;
//}
//}
}
}[/CODE]
Code:
4 Katea Murray 3.75 9 Matt Reese 2.89 11 Liz Huntley 3.98 12 Ken Black 2.99 11
grade
FirstName
LastName
Gpa
the program also needs a capability to search those arrays
// Search by first name
// Search by last name
// Search by Gpa
and to provide an overall Gpa average
and it needs to have a capabilty to add new students
please help
I already have the menu
[CODE=java]public void menu()
{
char ch=30;
char ch1=31;
int l;
for(int i=0;i<27;i++)
{
System.out.prin t(" ");
}
for(l=0;l<2;l++ )
{
for(int j=0;j<38;j++)
{
System.out.prin t(ch);
}
System.out.prin tln("");
for(int k=0;k<27;k++)
{
System.out.prin t(" ");
}
}
System.out.prin t(ch);
System.out.prin t(ch1);
for(int i=0;i<34;i++)
System.out.prin t(" ");
System.out.prin t(ch);
System.out.prin t(ch1);
System.out.prin tln("");
for(int i=0;i<27;i++)
System.out.prin t(" ");
System.out.prin t(ch);
System.out.prin t(ch1+" ");
System.out.prin t (" 1. Enter new Students record ");
System.out.prin t(" "+ch);
System.out.prin tln(ch1+" ");
for(int i=0;i<26;i++)
System.out.prin t(" ");
System.out.prin t(" "+ch1);
System.out.prin t(ch+" ");
System.out.prin t (" 2. Display All Student records and GPA: ");
System.out.prin t(" "+ch);
System.out.prin tln(ch1+" ");
for(int i=0;i<26;i++)
System.out.prin t(" ");
System.out.prin t(" "+ch);
System.out.prin t(ch1+" ");
System.out.prin t (" 3. Search students by first name: ");
System.out.prin t(" "+ch);
System.out.prin tln(ch1+" ");
for(int i=0;i<26;i++)
System.out.prin t(" ");
System.out.prin t(" "+ch);
System.out.prin t(ch1+" ");
System.out.prin t (" 4. Search students by last name: ");
System.out.prin t(" "+ch);
System.out.prin tln(ch1+" ");
for(int i=0;i<26;i++)
System.out.prin t(" ");
System.out.prin t(" "+ch);
System.out.prin t(ch1+" ");
System.out.prin t (" 5. Search searchstudents by GPA:");
System.out.prin t(" "+ch);
System.out.prin tln(ch1+" ");
for(int i=0;i<26;i++)
System.out.prin t(" ");
System.out.prin t(" "+ch);
System.out.prin t(ch1+" ");
System.out .print(" 6. Replace Student Record: ");
System.out.prin t(" "+ch);
System.out.prin tln(ch1+" ");
for(int i=0;i<26;i++)
System.out.prin t(" ");
System.out.prin t(" "+ch);
System.out.prin t(ch1+" ");
System.out .print(" 7. Delete Record: ");
System.out.prin t(" "+ch);
System.out.prin tln(ch1+" ");
for(int i=0;i<26;i++)
System.out.prin t(" ");
System.out.prin t(" "+ch);
System.out.prin t(ch1+" ");
System.out .print(" 8. Exit: ");
System.out.prin t(" "+ch);
System.out.prin tln(ch1+" ");
for(int j=0;j<27;j++)
System.out.prin t(" ");
System.out.prin t(ch);
System.out.prin t(ch1);
for(int i=0;i<34;i++)
System.out.prin t(" ");
System.out.prin t(ch);
System.out.prin t(ch1);
System.out.prin tln("");
for(int i=0;i<27;i++)
System.out.prin t(" ");
for(int i=0;i<38;i++)
System.out.prin t(ch);
System.out.prin tln("");
for(int i=0;i<27;i++)
System.out.prin t(" ");
for(int i=0;i<38;i++)
System.out.prin t(ch);
//Scanner input = new Scanner ( System.in);
//int s;
int choice=0;
String strChoice = JOptionPane.sho wInputDialog(nu ll,"Pick your action");
choice = Integer.parseIn t(strChoice);
//s=new input.nextInt() ;
// SimpleComparato r(int s) {
switch (choice) {
case 1:
new_student();
break;
case 2:
display_allstud ents();
dispay_gpa_aver age
break;
case 3:
search_by_first _name();
break;
case 4:
search_by_last_ name();
break;
case 5:
search_by_gpa() ;
break;
case 6:
replace_record( );
break;
case 7:
delete_record() ;
break;
case 8:
break;
default:
break;
//}
//}
}
}[/CODE]
Comment