Win a copy of TDD for a Shopping Website LiveProject this week in the Testing forum!

Mike Rothgeb

Ranch Hand
+ Follow
since Feb 17, 2016
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 Mike Rothgeb

Thanks for all your assistance guys.....
6 years ago
Please explain how to populate the array.....I'm fine, thank you....I'm here to learn.
6 years ago
Okay! You stated.
"BUT, you want to assign result to an array element. So, you need to change product on both lines to an array position i. Now you need to work out how to do that."

I'm not sure what you mean. I'm blank...

6 years ago
Correct. the values are all 0. By adding the i++ in the for statement. That populates it with 0 thru 49, correct.
6 years ago
In my for statement. Does that not populate the array?
6 years ago
I read that too about the memory space. I am going to attempt to make a point here somewhere down the line as I reference information from a couple books which show examples of what I have done works. I clearly don't know enough about the language to know if the information is good or not so good or garbage. But I will gain clarity. And that will be achieved regardless of the struggle......Thanks for your patience
6 years ago
I will say this....In a beginning java book it clearly states you can initialize the array with a statement similar to that here. I am not saying I agree with that but I am putting it out there for the purpose of this dialog.....That's all I am saying. In my code it is line 7 I believe....The for statement
6 years ago
Line 5
6 years ago
And I've seen it called that as well. Should it be located somewhere other than in the for statement? Say after the else statement.
6 years ago
I'm sorry. Then I am not understanding the accumulator. I have seen examples done similar to this. And I realize they might not be right. I have also read much more in depth information about accumulators, so it is safe to say I am lost with that as well.
6 years ago
Okay! Now we should be here.

The tricky part of this problem is initializing the array with 10 values that add up to 26 miles. Assume you were to add up 3 values to make up 10 miles, the array can be initialized with the values 1, 2, and 7. Notice that the second value (2) is a small increment to the first value (1). Also notice that when you add (1 and 2), the result (3) never exceeds the target value (10). Calculating the difference between 10 and 3 produces 7 (the third value).
6 years ago
6 years ago
Task three is to output 10 items per line. So the next post will do that.
6 years ago
This answers task two. Displays the square of the first 25 and three times the last 25.


6 years ago
Better?

6 years ago