Quantcast
Channel: Programming Forums
Viewing all articles
Browse latest Browse all 51036

ArrayList question

$
0
0
I have a home assignment i have a ArrayList that containts this kind of varibales : Name, Age, ID number, and five grades of student, its somthing like a data base, so my question, one of the rules was to calculate average values of student names, so i did that, now i have to sort them from highest to lowest

These are the object in the arraylist:
CODE:
students s1 = new students("Miks", 20, 1203, 3,6,6,8,6);
students s2 = new students("Ieva", 23 , 1232, 7, 8, 8, 8,6);
students s3 = new students("Arturs", 50, 2459 , 4, 5, 6, 7, 7);

OUTPUT:
Miks average grade - 5.0
Ieva average grade - 7.0
Arturs average grade - 5.0

So now i have to sort them from lowest to highest, do i need to stor them in anothor arraylist, or use just simple array, i really cant figure it out.

Thank you for your help, first home assigment in java im a begginer so dont judge me so hard and my first post at programming forum, so her goes nothin

Viewing all articles
Browse latest Browse all 51036

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>