Design a Java program define the contents of two arrays of values whole. The arrays will be
Question:
Design a Java program define the contents of two arrays of values whole. The arrays will be the same size and their content will be defined within
int list1[] = {1, 2, 3, 4, 5};
int list2[] = {5, 2, 7, 3, 0};
The two arrays will be defined within the main program (main()). The program will have a method that will receive the references as arguments. to the two arrays and will return the sum of both arrays as a result stored in another array. Then the program will send the references of the three arrays to another method that will print the two original arrangements and the sum thereof. The output of the program should look similar to the following:
[1] + [5] = [6]
[2] + [2] = [4]
[3] + [7] = [10]
[4] + [3] = [7]
[5] + [0] = [5]
The operation of the program has to be independent of the size of the the two original arrays (but the two will always be the same size). During the evaluation of the program, the arrangements will be modified by changing its content and size. Programs have to be properly documented, well indented and the names of variables and methods have to be significant.
Building Java Programs A Back To Basics Approach
ISBN: 9780135471944
5th Edition
Authors: Stuart Reges, Marty Stepp