- 1
average from input
i have a .txt file from which I have to read some grades of students and calculate the average.
3 Réponses
0
Have one variable to store the sum of the grades, another one to count them, and update them each loop. At the end, the average is the first variable divided by the second.
0
use filereader object to read data from text file. and store them in variables and then calculate using formula.
0
save the text file as a .java file and run it from the cmd in Windows or download a compiler. I use the IDE eclipse for my programming. To do the sum create variables for each value and then a average variable to store your value in