Add each element in origList with the corresponding value in offsetAmount. Print each sum followed by a semicolon (no spaces). Ex: If the input is: XXXXXXXXXXthen output is: 6;9;17;15; import...


Add each element in origList with the corresponding value in offsetAmount. Print each sum followed by a semicolon (no spaces).

Ex: If the input is: 4 5 10 12 2 4 7 3 then output is: 6;9;17;15;





import java.util.Scanner;


public class ComputeOffset {


public static void main(String[] args) {
final int NUM_VALS = 4;
int[] origList = new int[NUM_VALS];
int[] offsetAmount = new int[NUM_VALS];
int i;
Scanner input = new Scanner(System.in);


origList[0] = input.nextInt();
origList[1] = input.nextInt();
origList[2] = input.nextInt();
origList[3] = input.nextInt();


offsetAmount[0] = input.nextInt();
offsetAmount[1] = input.nextInt();
offsetAmount[2] = input.nextInt();
offsetAmount[3] = input.nextInt();


/* Your code goes here */


System.out.println();
}
}



Jun 07, 2022
SOLUTION.PDF

Get Answer To This Question

Related Questions & Answers

More Questions »

Submit New Assignment

Copy and Paste Your Assignment Here