RCMS.cpp
/***********************SORTING BY PERCENTAGE***********************/
/*
To begin with, all the records are read, and the percentage of each student is sorted based
on ascending order of percentage. 

Once the percentages are sorted, they are then displayed, and the user returns to their access
level function
*/
SORTING BY PERCENTAGE
To begin with, all the records are read, and the percentage of each student is sorted based
on ascending order of percentage.

Once the percentages are sorted, they are then displayed, and the user returns to their access
level function
SORTING BY PERCENTAGE To begin with all the records are read and the percentage of each student is sorted based on ascending order of percentage . Once the percentages are sorted they are then displayed and the user returns to their access level function
void sortpercentage() {
    STUDENT s, t[100], temp;
    ifstream f("Record.dat");
    int n = 0;
    if (!f) {
        cout << "\n\n\n\n\n\n\n\n\n\n\n\t\t\t\tFILE NOT FOUND!";
        cout << "\n\n\n\n\n\n\n\n";
    } else {
        {
            while (f.read((char *) &s, sizeof(s))) {
                t[n++] = s;
            }
        }
        f.close();
        for (int i = 0; i < n; i++) {
            for (int j = 0; j < n - 1; j++) {
                if (t[j].percentage < t[j + 1].percentage) {
                    temp = t[j];
                    t[j] = t[j + 1];
                    t[j + 1] = temp;
                }
            }
        }
        cout << "\t\t\t  -----------------------------------" << "\n";
        cout << "\t\t\t     LIST OF CLASS RECORDS(SORTED)" << "\n";
        cout << "\t\t\t  -----------------------------------" << "\n\n";
        for (int i = 0; i < n; i++) {
            t[i].display_all();
            cout << "\n\n\n\t\t---------------------------------------------\n\n\n";
        }
    }
}
void sortpercentage ( ) { STUDENT s , t [ 100 ] , temp ; ifstream f ( " " ) ; int n = 0 ; if ( ! f ) { 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 " ; } else { { while ( f . read ( ( char * ) & s , sizeof ( s ) ) ) { t [ n ++ ] = s ; } } f . close ( ) ; for ( int i = 0 ; i < n ; i ++ ) { for ( int j = 0 ; j < n - 1 ; j ++ ) { if ( t [ j ] . percentage < t [ j + 1 ] . percentage ) { temp = t [ j ] ; t [ j ] = t [ j + 1 ] ; t [ j + 1 ] = temp ; } } } cout << " \t \t \t " << " \n " ; cout << " \t \t \t " << " \n " ; cout << " \t \t \t " << " \n \n " ; for ( int i = 0 ; i < n ; i ++ ) { t [ i ] . display_all ( ) ; cout << " \n \n \n \t \t \n \n \n " ; } } }
SORTING BY PERCENTAGE
To begin with, all the records are read, and the percentage of each student is sorted based
on ascending order of percentage.
SORTING BY PERCENTAGE To begin with all the records are read and the percentage of each student is sorted based on ascending order of percentage .
/*******************DISPLAYING THE SORTED RECORDS*******************/ //         getch();
