1answer.
Ask question
Login Signup
Ask question
All categories
  • English
  • Mathematics
  • Social Studies
  • Business
  • History
  • Health
  • Geography
  • Biology
  • Physics
  • Chemistry
  • Computers and Technology
  • Arts
  • World Languages
  • Spanish
  • French
  • German
  • Advanced Placement (AP)
  • SAT
  • Medicine
  • Law
  • Engineering
AleksandrR [38]
3 years ago
9

Subtract each element in origList with the corresponding value in offsetAmount. Print each difference followed by a space. Ex: I

f origList = {4, 5, 10, 12} and offsetAmount = {2, 4, 7, 3},
print: 2 1 3 9
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] = 2;
offsetAmount[1] = 3;
offsetAmount[2] = 6;
offsetAmount[3] = 5;
*\your code here*\
System.out.print
Computers and Technology
1 answer:
mafiozo [28]3 years ago
7 0

Answer:

Replace

*\your code here*\

System.out.print

with the following lines code

int difference;

for(int j = 0; j<=3;j++)  {

difference = origList[j] - offsetAmount[j];

System.out.print(difference+" ");

}

Also, your program is  not well ended

At the end of the above code, write the following

}

}

Explanation:

The first line of the above code segment declares an integer variable named difference

The next line declares and starts a loop using an iterative variable named j

j is declared of type integer and it takes the range of 0 to 3

The next line calculates the difference between each element of array origList and the corresponding element of offsetAmount.

This difference is saved in variable difference

The next line prints the calculated difference followed by a blank space

The last line of the code segment ends the iteration

You might be interested in
In the lab, wireshark continued to capture data in the background until the:
Alex17521 [72]
In the lab, Wireshark continued to capture data in the background until the capture process was manually stopped later in the lab.
Wireshark is a packet analysis tools, it gets the information for traffic passing through a specific network node.

5 0
3 years ago
FIRST TO Answer for free brainlest. GOG GOGOGO
oksano4ka [1.4K]

Answer:

ME

Explanation:

5 0
3 years ago
Write the code for invoking a static method named sendTwo, provided by the DataTransmitter class. There are two arguments for th
MAVERICK [17]

Answer:

DataTransmitter.sendTwo(15.955, 13);

Explanation:

The code above will call the method sendTwo() which exists inside the class DataTransmitter

Because this a static method it can be invoked with only the dot operator without making an object of the DatTransmitter class with the new Operator

Since the method sendTwo () accepts two parameters of type double and int respectively, the values 5.955, 13 are passed as argument during the method call.

5 0
3 years ago
Richard wants to create a cloud-based system that will be a centralized repository of log files from various servers in the orga
jeyben [28]

Answer:

CAD ( d )

Explanation:

Richard should use CAD to create a cloud-based system, since he wants it to be a centralized repository of log files to be taken from the different servers associated with the organization

CAD ; Computer aided design software is the best software to be used because files created using CAD can be easily stored in cloud and it is easily accessible.

4 0
3 years ago
When talking about careers in designing game art, the unit mentioned that a good portfolio and a clear record of experience in g
atroni [7]

Answer:

Explanation:

Many different answerd to this

I dont know what course your taking exactly but i'll do my best <3

Personnally im most interested in balancing in game rewards, balancing AI, or balancing in game currency.

Hmm... I dont really kno what you could add to your portfolio tho. Maybe some things you did that involve what youre interested in doing.

Hope this helps <3

8 0
3 years ago
Other questions:
  • ____ is a generic term for "evil software." threat worm virus malware
    9·1 answer
  • For the question below, refer to the following recursive factorial method.
    8·1 answer
  • Peter was working on a design for a magazine. He had to give his design to his team for further editing. He wanted to use a file
    8·1 answer
  • 1
    13·1 answer
  • Does unturned game is good for low end PC that without graphics card?​
    5·1 answer
  • Character positions in<br> arrays start counting with<br> the number 1.<br> True<br> False
    14·1 answer
  • True or false As the contents and topics of new magazines change year-to-year, you can see various trends and movements across s
    15·1 answer
  • Which of the following is a capital resource a computer programmer
    15·1 answer
  • What are the three parts of a camera
    6·1 answer
  • Identify the true statements about the approach to privacy around the world. a. Uncertainty concerning the nature, extent, and v
    11·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!