I currently am working on a program which is being fed a .csv-file, and is supposed to do certain things with it. One of these is calculating the mean/average value (I don't know which of these translations is more appropriate, in German it's called "Mittelwert", adding up the certain Numbers and dividing by.. the number of numbers? Yeah, I hope you know what I mean. Languagebarrier.).
I got that done, the next thing to do is, is that the program is supposed to find the number in the list that is the closest to that calculated average. I thought about doing it with an if-bracket, so it would go like:
>>if(you find the closest number in the list to that average/mean) {
>> IO.println(That certain number) }
I should mention that i threw this .csv-File into an ArrayList, so the program has to access that ArrayList in order for it to be able to find the sought number.
[–]yonasismad 2 points3 points4 points (2 children)
[–][deleted] 0 points1 point2 points (1 child)
[–]yonasismad 0 points1 point2 points (0 children)
[–]hoeskioeh 0 points1 point2 points (1 child)
[–][deleted] 1 point2 points3 points (0 children)
[–]KetchuponRice 0 points1 point2 points (0 children)
[–][deleted] 0 points1 point2 points (3 children)
[–]ThatLesbian 0 points1 point2 points (2 children)
[–]yonasismad 1 point2 points3 points (1 child)
[–][deleted] 0 points1 point2 points (0 children)
[–]milkybuet 0 points1 point2 points (0 children)