Computers and Technology

Multiply each element in origList with the corresponding value in offsetAmount. Print each product followed by a space.
Ex: If origList = {4, 5, 10, 12} and offsetAmount = {2, 4, 7, 3}, print:

8 20 70 36
import java. util. Scanner;

public class VectorElementOperations {
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;

origList[0] = 20;
origList[1] = 30;
origList[2] = 40;
origList[3] = 50;

offsetAmount[0] = 4;
offsetAmount[1] = 6;
offsetAmount[2] = 2;
offsetAmount[3] = 8;

/* Your solution goes here */

System. out. println("");
}
}

answer
Answers: 1

Other questions on the subject: Computers and Technology

image
Computers and Technology, 22.06.2019 09:30, caldonjoshhsms2061
What are the steps involved in accepting all the changes in a document? arrange these in order click edit. click accept or reject. click changes. click accept all.
Answers: 1
image
Computers and Technology, 22.06.2019 12:30, zaratayyibah
Which of the choices sean are not true when considering virus behavior
Answers: 1
image
Computers and Technology, 22.06.2019 19:00, dadonelson2109
If your accelerator suddenly gets stuck what should you do
Answers: 2
image
Computers and Technology, 23.06.2019 12:00, daelinrobinson
If you're using an existing powerpoint presentation that will receive new slides based on a word outline, select the a. slide that will appear after the new slides. b. first slide in the presentation. c. slide that will appear before the new slides. d. last slide in the presentation.
Answers: 2
Do you know the correct answer?
Multiply each element in origList with the corresponding value in offsetAmount. Print each product f...

Questions in other subjects:

Konu
Mathematics, 30.11.2020 22:50