Lab goal is to practice problem-solving using previous concepts such as arrays, loops, and if's. Also use an enhanced for loop.
Write a program to swap the even numbered elements of two arrays
If array1 = [0, 1, 2, 3, 4, 5] and array2 =[6, 6 , 6, 6, 6, 6] to start, the arrays after should be array1 = [6, 1, 6, 3, 6, 5] and array2 = [0, 6, 2, 6, 4, 6]
Use an enhanced for loop in your program. (Section 5.9)
Print both arrays before the swap and again after the swap with appropriate identification
Submit the java file and screen shots showing your running program
Grading
| Code comments, variables commented | 15 |
| ForEach Loop used in program | 15 |
| Array values printed before swap | 15 |
| Correct array values printed after swap | 35 |
| Program compiles | 10 |
| Screen shots showing running program and java file provided | 10 |