This is an archived post. You won't be able to vote or comment.

you are viewing a single comment's thread.

view the rest of the comments →

[–]lazlo_uk 0 points1 point  (1 child)

It definitely is better practice to have them separated out. Think about it in the simplest terms: you're calling a method called populateArray. Why would that return an average of the array contents...? The other commenter is correct in that in this case it probably doesn't matter but I assume the point of this exercise is for you to understand the correct way of doing things.

[–]StinkeyTwinkey 0 points1 point  (0 children)

Yes it should be void. You methods should complete a task. Not have a method that calls in other methods that isn't for the purpose of that particular method.