Originally Posted by
ArkM
Only getTotal code is correct. All three other fuctions are wrong.
1. getAverage: use getTotal to obtain a sum of all elements then divide sum by the number of elements!
2. getLargest and getSmallest: why double largest = array[100]; ?! No such element in the array at all. Start from array[0] value then loop from index 1.
lol I forgot to change the array back to 0, I was just messing around with things to see what would happen. And for the getAverage I can't seem to get it to work properly. Everytime I call getTotal I get some sort of syntax error. I'll tinker around with it again and see if i can get it to work as you've described.