Forums Register Login

Array iteration/output problem

+Pie Number of slices to send: Send
Hello

I have to write a for loop, to iterate through an array and output the contents of the array (see below). I know how to write the code for the iteration but am having a problem with the output.

The output should go

mortgageType [1] = array contents.
mortgageType [2] = array contents.

I can get the array index to print out ( but cannot get the others to print on the same line. Any ideas?

Also, I have one loop and am wondering should I have 2?

Any help gratefully received.
+Pie Number of slices to send: Send
Do you want to do this ?

+Pie Number of slices to send: Send
 

Originally posted by Helen Back:
...The output should go

mortgageType [1] = array contents.
mortgageType [2] = array contents.
...


Note that array indexing starts at zero. So, for example, if your array has 3 elements, these would be indexed as...

mortgageType[0]
mortgageType[1]
mortgageType[2]
+Pie Number of slices to send: Send
Helen --

Please contact me by email (click the little icon of a speedy stamped envelope at the top of this post.) Thank you.
+Pie Number of slices to send: Send
Thanks all, just the starting point I needed, I can probably figure it out now.
It was the best of times. It was the worst of times. It was a tiny ad.
a bit of art, as a gift, the permaculture playing cards
https://gardener-gift.com


reply
reply
This thread has been viewed 664 times.
Similar Threads
Crazy question
Array output
Java Help... so frustrated!!
Help with displaying output
Reverse an array in java
More...

All times above are in ranch (not your local) time.
The current ranch time is
Mar 28, 2024 15:59:31.