I suck pretty bad with functions and 2D arrays. I am having a very hard time getting the program to execute the correct average for me. Any advice? Am I calling the function wrong? Am I not writing the function correctly? Do I need to start completely over? ...I'm desperate!
The objective is to create a 3 x 7 array that holds three monkeys and the seven days of the week. The user is to input the data for each monkey. Then the program should:
>Create a report that includes the average amount of food eaten per day by the whole family of monkeys
>The least amount of food eaten during the week by one monkey.
>The greatest amount of food eaten during the week by one monkey.
(I'm not completely finished writing the code by the way)
total is an int, so total/7 is an int. For example, 13 / 7 is 1. You can fix this by making total double type.
Anyway, if you're supposed to be working out the average amount of food eaten by the monkeys, and there are three monkeys, why are you dividing by seven?
Thank you so much Moschops! And I'm sorry...I knew I was supposed to divide by 3, but the formula wasn't giving me the correct answer, so I changed it to 7 instead...just to see if the answer would change. But unfortunately, the program still gave me zero. I've fixed it now, thanks to you!