Pairs of Arrays Tutorial

From Progzoo
Jump to: navigation, search

In these questions you must complete the method doStuff.

The system will call your method three times with a two arrays each time. You may be sure the arrays are the same length.

Your method should give the output specified each time.

Side by side

Print the Pairs

Testing array :[A, B, C] and [X, Y, Z]
A X
B Y
C Z


[Font] [Default] [Show] [Resize] [History] [Profile]

Add consecutive pairs

Print element 0 add element 1, 2 add 3, 4 add 5

For the array [2, 7, 5, 3] you should print 9 and 8 (that is 2+7 and 5+3).


[Font] [Default] [Show] [Resize] [History] [Profile]

Print Consecutive Pairs

Print element 0 and element 1 on the first line, print 2 and 3 on the second...

For the array [2, 7, 5, 3] you should print:

2 7
5 3


[Font] [Default] [Show] [Resize] [History] [Profile]

Print Columns

Print the numbers in two columns

For the array [2, 7, 5, 3, 5, 6] you should print:

2 3
7 5
5 6


[Font] [Default] [Show] [Resize] [History] [Profile]