RCMS.cpp
/******************SEARCING FOR A RECORD (STUDENT)******************/
/*
To search for a particular student's record, that students' roll number must be enterred.
If a matching number is found within the list of students, then the user must enter the passcode
associated with that student. 

If both the roll number and the secure passcode match for the found student, then that record is displayed
using the display_record() function.

If the roll number is not found, the user is pushed back to their access level function
*/
SEARCING FOR A RECORD (STUDENT)
To search for a particular student's record, that students' roll number must be enterred.
If a matching number is found within the list of students, then the user must enter the passcode
associated with that student.

If both the roll number and the secure passcode match for the found student, then that record is displayed
using the display_record() function.

If the roll number is not found, the user is pushed back to their access level function
SEARCING FOR A RECORD ( STUDENT ) To search for a particular student ' s record that students ' roll number must be enterred . If a matching number is found within the list of students then the user must enter the passcode associated with that student . If both the roll number and the secure passcode match for the found student then that record is displayed using the display_record () function . If the roll number is not found the user is pushed back to their access level function
void search_student() {
    STUDENT s;
    ifstream f("Record.dat");
    int n, flag = 0;
    char a[5];
    if (!f) {
        cout << "\t\t\t\tFILE NOT FOUND!";
        cout << "\n";
    } else {
        cout << "\t\t\t";
        cout << "ENTER YOUR ROLL NUMBER: ";
        cin >> n;
        cout << "\n\t\t\t";
        cout << "ENTER YOUR SECURE CODE: ";
        cin.ignore();
        cin.getline(a, 5);
        system("cls");
        while (f.read((char *) &s, sizeof(s))) {
            if ((n == s.roll_number) && (strcmp(a, s.passcode) == 0)) {
                flag = 1;
                s.display_report();
            }
        }
        if (flag == 0) {
            cout << "\n\n\n\n\n\n\n\n\n\n\n\t\t\t\tRECORD NOT FOUND!";
            cout << "\n\n\n\n\n\n\n\n";
        }
    }
    f.close();
}
void search_student ( ) { STUDENT s ; ifstream f ( " " ) ; int n , flag = 0 ; char a [ 5 ] ; if ( ! f ) { cout << " \t \t \t \t " ; cout << " \n " ; } else { cout << " \t \t \t " ; cout << " " ; cin >> n ; cout << " \n \t \t \t " ; cout << " " ; cin . ignore ( ) ; cin . getline ( a , 5 ) ; system ( " " ) ; while ( f . read ( ( char * ) & s , sizeof ( s ) ) ) { if ( ( n == s . roll_number ) && ( strcmp ( a , s . passcode ) == 0 ) ) { flag = 1 ; s . display_report ( ) ; } } if ( flag == 0 ) { cout << " \n \n \n \n \n \n \n \n \n \n \n \t \t \t \t " ; cout << " \n \n \n \n \n \n \n \n " ; } } f . close ( ) ; }
SEARCING FOR A RECORD (STUDENT)
To search for a particular student's record, that students' roll number must be enterred.
SEARCING FOR A RECORD ( STUDENT ) To search for a particular student ' s record that students ' roll number must be enterred .