I need to take my code here and in the output report sort it so its the people with the highest averages at the top and the people with the lowest averages at the bottom. How do I do this?
I'd start with creating an average variable, it'll be easier to keep track of your tests.. Also, create an array for the tests of the students.
double Avg = (s.test1+s.test2+s.test3)/3;
That way when you create the oh so needed for loop, you can have a fun time.. double testAvg[numOfAverages]={(Input here the instructions for getting test averages)}
1 2 3 4 5
for (int x = 0; x < numOfAverages; x++){
if(testAvg[x]>testAvg[0]){
testAvg[0] = testAvg[x]
}
}
I know it's not much, but it'll simplify what the more experienced coder after me will have to say.
I'm a very beginner programmer, and your code looks way too foreign to me at my current state.. Haven't had much play with std:: but it looks to be another way of creating a sort of class maybe? Not sure.. Anyway, no bashing please, only giving as much input as I can.
Not sure why you'd name the two overloaded operators as friend function since they are actually member functions. Not only that, structs have public default access, so they don't need private member access anyway.