Win a copy of Head First Android this week in the Android forum!

Joe Saunders

Greenhorn
+ Follow
since May 14, 2009
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 Joe Saunders

That's odd... What would cause you to get the correct value, but for me to get something way too high??
12 years ago
This is my latest code.



I thought that might be the issue Henry, however it doesn't seem to be that way.

To show... I ran the program and get these numbers:
83, 19, 30, 55, 7, 28, 49, 10, 15, 9, 32, 39, 74
The sum should be 450, however I receive a sum of 53144 from the program.

12 years ago
I understand why it should be < 1500 and > 15 but I get numbers with 5 digits such as 75615, depending on which values are assigned.
12 years ago
I'm looking, I don't see the issue... it would make sense I was getting a very large sum if I was accidentally assigning too many values to the array, but from what I see, I'm not..
12 years ago
Okay, that makes sense . The minimum value is working now, but the I still get a much too high of a number for the sum.
12 years ago
The length of the array is 15 and I'm assigning values for 0-14... ?
12 years ago
It gives me a value of 0 for the minimum value every time.
Sorry, I put the sum back to "sum = sum + number[a]". I had changed this when trying to get it to work, however even this still doesn't calculate the sum.
12 years ago
For whatever reason, the for loop can find the maximum value of the randomly generated array O.K., but when it tries to find the minimum or sum the array it is wrong.
Any help is appreciated! I've been working on this for days though it should be easy enough...
Thanks in advanced.

12 years ago