Question: Write it in JAVA The program reads in one integer (n), followed by two integer arrays arrayl and array2) of length n Processing For each
Write it in JAVA
The program reads in one integer (n), followed by two integer arrays arrayl and array2) of length n Processing For each element z in arrayl, check whether or not the respective element y in array2 is the sum of z and 17. That is, check whether or not y+17. If the sums match, move on to the next element. If an error is found, output as follows Output If all sums match, output "It all adds up" and terminate this with a new-line character Otherwise, at the first sum error found, output the following x+17 : y (not z) where z is the value from arrayl, z is the value from array2 and y is the sum that would be expected. The text must be terminated by a new-line character Examples Sample Input Sample Output It all adds up 1 1718 (not 21) 23 + 1740 (not 39) 2 21 19 18 2 21 19 21 2 23 1 39 18
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
