Answered step by step
Verified Expert Solution
Question
1 Approved Answer
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 18Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started