This week's book giveaway is in the Java in General forum.
We're giving away four copies of Java by Comparison (eBook) and have Simon Harrer, Jörg Lenhard, Linus Dietz on-line!
See this thread for details.
Win a copy of Java by Comparison (eBook) this week in the Java in General forum!

unyime inok

Greenhorn
+ Follow
since Oct 13, 2004
Cows and Likes
Cows
Total received
0
In last 30 days
0
Total given
0
Likes
Total received
0
Received in last 30 days
0
Total given
0
Given in last 30 days
0
Forums and Threads
Scavenger Hunt
expand Ranch Hand Scavenger Hunt
expand Greenhorn Scavenger Hunt

Recent posts by unyime inok

the calStandardDev() works if you're assigning values to the array directly or reading from the keyboard, doesn't work if you're reading from a file. once i fix the readInteger() it should be fine.
13 years ago
the specification requires that the numbers be read and stored into an array, then use that to calculate the average and standard dev. Now the only problem is that the zero that gets returned if the end of file has been reached gets stored also, increasing the length of the array, thus giving an incorrect output for the standard dev.
13 years ago
Hi David,
I've not yet fixed, I just realized that the problem is from my readInteger() , so i'm trying to figure out how to fix that.
13 years ago
i don't know why i don't get the correct output over here, probably because i'm reading from a file. i've tried everything or could it be the editor i'm using? i tried running with NetBeans IDE and Drjava, but i still get wierd answers for the standard dev. Anyway, thanks for your time and concern Joyce.
13 years ago
Hi joyce,
thanks for your time. from 1,2,3 the average is suppose to = 2(i.e 1+2+3/3)
while the standard dev = 1.
I'm reading my input from a file and the values are
45
5
53
7
88
32
2
1
5
The results i get are:
The Average is: 26.444444444444443
The Standard is: 26.789359534381877

Average is correct, but standard dev is suppose to = 30.4389188


Below is the class i'm reading the file from:

13 years ago
Hi., i'm reading integers from a file. i've been to read input from the file and also calculate the average, but the standard deviation is yielding the wrong output, help please.what should i change or add.





13 years ago
Please help me figure out why my calStandardDev() is giving an incorrect answer
13 years ago
Please help me figure out why my calStandardDev() is giving an incorrect answer.



13 years ago
Thanks a lot. i'll try doing that.
13 years ago
how do i fix this please?
java.lang.ArrayIndexOutOfBoundsException: 50
at IntFile1.readInteger(IntFile1.java:54)




13 years ago
Thanks, i got it figured out
13 years ago
can someone please help me resolve this Error:java.io.FileNotFoundException? i'm trying to open a text file and it's saved in the same directory as the java program that i'm using to open it but i'm getting the above error.
13 years ago
can someone please help me resolve this Error:java.io.FileNotFoundException? i'm trying to open a text file and it's saved in the same directory as the java program that i'm using to open it but i'm getting the above error.
13 years ago
Thank you for your responses
13 years ago
i did that already, but i still get the same error. the file i'm trying to open is in the same directory and i used the same editor to create it.
13 years ago