Answered step by step
Verified Expert Solution
Question
1 Approved Answer
Examine the following program: class Exercise4 { public static void main ( String[] args ) { int[] valA = { 13, -22, 82, 17}; int[]
Examine the following program:
class Exercise4 { public static void main ( String[] args ) { int[] valA = { 13, -22, 82, 17}; int[] valB = { 0, 0, 0, 0}; // Put values into valB so that the sum of the values // in corresponding cells of valA and valB is 25. System.out.println( "valA: " + valA[0] + " " + valA[1] + " " + valA[2] + " " + valA[3] ); System.out.println( "valB: " + valB[0] + " " + valB[1] + " " + valB[2] + " " + valB[3] ); System.out.println( "sum: " + (valA[0]+valB[0]) + " " + (valA[1]+valB[1]) + " " + (valA[2]+valB[2]) + " " + (valA[3]+valB[3]) ); } }
Complete the program with four assignment statements that put values into valB so that the sum of corresponding cells in valA and valB is 25.
Step 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