Not Getting Proper Output | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
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.

23rd Oct 2016, 1:29 PM
Amitrajit Bose
Amitrajit Bose - avatar
1 Answer
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 :-)
31st Dec 2016, 12:29 PM
Tomáz
Tomáz - avatar