Question: Problem #2: Adding two arrays AddArrays that accomplishes the following tasks: Write a Java program 1. Declare and instantiate two integer arrays that will hold
Problem #2: Adding two arrays AddArrays that accomplishes the following tasks: Write a Java program 1. Declare and instantiate two integer arrays that will hold 5 elements each. 2. Read 5 values into the first array, then read 5 values into the second array. 3. Finaly, output both arrays, each on a single line, and then output the result of adding parallel positions in the two arrays in the format seen below: For first array: Enter value for element 0: 10 Enter value for element 1: 20 Enter value for element 2: 30 Enter value for element 3: 40 Enter value for element 4: 50 For second array: Enter value for element 0: 1 Enter value for element 1: 1 Enter value for element 2: 2 Enter value for element 3: Enter value for element 4: 4 Pirst array: 10 20 30 40 50 second array: 11 2 34 Results: 11 21 32 43 54
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
