0
Not Getting Proper Output
https://code.sololearn.com/cbK9kKmKhnIB Refer the following programme. I coded this myself but I am not getting a proper output. Using scanner class I wanted to design a sorted report card which would accept marks and subject and return them in sorted manner with total and average. Kindly help me.
1 Réponse
0
Greetings.
Well... I don't really know why this happens, but by changing:
sub[i] = sc.nextLine();
To
sub[i] = sc.next();
In line 14 produces the desired output.
And, if I may, I advise you to use floating points when acquiring the grades.
Hope this helped
:-)