You're welcome.
Type: Posts; User: Norm
You're welcome.
That is an example of a for loop that controls two indexes. It is only an example.
Did you copy it to a test class, compile and execute it to see how the values of i and j change? If that is too...
The for loop has a built in index usage feature. You can then manually write code that executes inside the loop for any other indexes you need.
Alternately the for loop can handle multiple...
Did you understand and work through my suggestions in post#8?
Using the variable names suggested in post#10 will help.
Are you asking how to build the full String from the array's elements?
Use the concatenation operator: + in a loop to concatenate all the elements to a String.
Look at the logic I suggested in post#8. Did you do the paper and pencil exercise?
How did you create and populate the array? That will determine the index to the last element in the array.
...
To work out the steps the code must take to solve the problem, take a piece of paper and write on a line a sample list of words. Then put pointers under the first words to be swapped(the first one...
That swap should be very easy.
That would take a loop with some indexes to keep track of what elements to swap.
What have you tried?
Can you explain what words are supposed to be swapped?
Why do you think there needs to be a loop to do the swapping? A loop would be used if all the words need to be moved around. If there are...
Put the words in an array where swapping them will be easy.