I need to write a program that allows the user input 5 student's names and grades. Then the program would sort the data and output who has the first highest grade, then second, third, and so on.
I used bubble sort to sort the grades, but i have no idea of how to sort the names. Is there any way to sort both integers and strings at the same time? Or is there an easier way to write the program? Here is what i got so far...
I haven't learn anything about struct yet, so i really don't know how it works. =(
How should i code it so the name array would perform the same swaps?
The name has to change at the same time the grade does for example
name[i][j];
grade[i];
But a better choice would be to learn about structs and use one, theres nothing stopping you and there pretty simple, a struct just holds a bunch of variables under a single name.