Expand|Select|Wrap|Line Numbers
- int Search(Student List[], int Size, string Target)
- {
- for(int i = 0 ; i < Size ; i++)
- if (Target == List[i].LastName)
- return i;
- return -1;
- }
- void Edit_Record(Student List[], Student & Temp)
- {
- int Index;
- string Target;
- int Size = 0;
- cout << "Please enter the student Last Name you want to edit: ";
- cin >> Target;
- Index = Search(List,Size,Target);
- if(Index!=-1){
- cout<<"Procede to change the student's information"<<endl;
- cout << "Enter Student" << List[Index].LastName + ", " + List[Index].FirstName << "'s new information" << endl;
- cout << "Enter the new First Name: ";
- cin >> List[Index].FirstName;
- cout << "Enter the new Last Name: ";
- cin >> List[Index].LastName;
- cout << "Enter the new Quiz Score: ";
- cin >> List[Index].Quiz;
- cout << setw(20) <<"Scores for Six Tests:" << endl ;
- for (int j = 0 ; j < 6 ; j++)
- {
- cout <<setw(7)<< " Test # " << j+1 << ": " ;
- cin >> List[Index].Test[j];
- }
- }
- else
- cout << "\nThis student information does not exist on the list. Try again.\n";
- List[Index] = Temp;
- }