answer.
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
Delvig
2 months ago
13

Multiply each element in origList with the corresponding value in offsetAmount. Print each product followed by a space.Ex: If or

igList = {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("");}}

Engineering
1 answer:
Kisachek [356]2 months ago
8 0

Answer:

Here is the JAVA program:

import java.util.Scanner; // to take input from user

public class VectorElementOperations {

public static void main(String[] args) {

final int NUM_VALS = 4; // size is fixed to 4 assigned to NUM_VALS

int[] origList = new int[NUM_VALS];

int[] offsetAmount = new int[NUM_VALS];

int i;

//two arrays origList[] and offsetAmount[] get assigned their values

origList[0] = 20;

origList[1] = 30;

origList[2] = 40;

origList[3] = 50;

offsetAmount[0] = 4;

offsetAmount[1] = 6;

offsetAmount[2] = 2;

offsetAmount[3] = 8;

String product=""; // variable for storing the product results

for(i = 0; i <= origList.length - 1; i++){

/* iterates from 0 to the end of origList */

/* multiplies each origList entry with the corresponding offsetAmount entry, stores results in product */

product+= Integer.toString(origList[i] *= offsetAmount[i]) + " "; }

System.out.println(product); }}

Output:

80 180 80 400

Explanation:

If you wish to print the product of origList alongside offsetAmount values vertically, this can be done in this manner:

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;

for(i = 0; i <= origList.length - 1; i++){

origList[i] *= offsetAmount[i];

System.out.println(origList[i]);}

}}

Output:

80

180

80

400

The program is shown with the output as a screenshot along with the example's input.

You might be interested in
An air duct heater consists of an aligned array of electrical heating elements in which the longitudinal and transverse pitches
Kisachek [356]

Answer:

a) q = 7671 W

T0 = 47.6°C

b) ΔP = 202.3 N/m²

P = 58.2 W

c) hDarray = 2 times hD of an isolated element.

Explanation:

see the image for the solution.

4 0
2 months ago
Suppose we include the lead resistance in the calculation of temperature for a class A RTD. If R3 = 1000 ohms, Ra = 18 ohms, V0
alex41 [359]

Respuesta:

La temperatura máxima que se puede medir (en °C) es 14170.27°C

Explicación:

Los RTDs son termómetros compuestos de metales cuya resistencia aumenta con la temperatura.

Para un RTD de Clase A, l, Alpha = 0.00385.

La fórmula para el RTD es

Rt = Ro ( 1 + alpha x t)

Donde

Rt es la resistencia a la temperatura t°C,

Ro es la resistencia a 0°C

Alpha es un coeficiente de temperatura constante para un RTD de clase A.

Aquí, Rt = 1000ohms,

Ro se considera como Ra = 18Ohms

Por lo tanto,

1000 = 18 ( 1 + 0.00385t)

Dividiendo ambos lados por 18

1 + 0.00385t = 1000/18

0.00385t = 55.55 - 1

0.00385t = 54.55

t = 54.55/0.00385

t = 14170.27°C

5 0
1 month ago
Can a 1½ " conduit, with a total area of 2.04 square inches, be filled with wires that total 0.93 square inches if the maximum f
Kisachek [356]
It is not feasible to install the wires within the conduit. Explanation: The given dimensions show that the total area is 2.04 square inches while the wires occupy 0.93 square inches. The maximum allowable fill for the conduit is 40%. To determine if placement is possible, compute the conduit’s area at 40% which equates to 0.816 square inches, less than the required area of the wires.
4 0
2 months ago
The first step to merging is entering the ramp and _____.
alex41 [359]

Answer:

D.informing your passengers of your destination

7 0
2 months ago
A cylinder in space is of uniform temperature and dissipates 100 Watts. The cylinder diameter is 3" and its height is 12". Assum
Kisachek [356]

Answer:

Temperature T = 394.38 K

Explanation:

The full solution and detailed explanation regarding the above question and its specified conditions can be found below in the accompanying document. I trust my explanation will assist you in grasping this particular topic.

7 0
2 months ago
Other questions:
  • Two streams flow into a 500.0-gallon tank. The first stream is 10.0 wt % ethanol and 90.0 wt% hexane (mixture density is rho1 0.
    15·1 answer
  • A manometer measures a pressure difference as 40 inches of water. Take the density of water to be 62.4 lbm/ft3.What is this pres
    13·1 answer
  • Your employer has the ability to protect you from cave-ins and other hazards by using adequately-designed protection systems in
    13·1 answer
  • 1 At a certain location, wind is blowing steadily at 10 m/s. Determine the mechanical energy of air per unit mass and the power
    11·1 answer
  • Consider a process carried out on 1.00 mol of a monatomic ideal gas by the following two different pathways.
    13·1 answer
  • Radioactive wastes are temporarily stored in a spherical container, the center of which is buried a distance of 10 m below the e
    13·1 answer
  • A bankrupt chemical firm has been taken over by new management. On the property they found a 20,000-m3 brine pond containing 25,
    13·1 answer
  • Gina is about to use a fire extinguisher on a small fire. What factor determines the type of extinguisher she should use
    9·2 answers
  • The water level in a large tank is maintained at height H above the surrounding level terrain. A rounded nozzle placed in the si
    9·1 answer
  • A thermocouple element when taken from a liquid at 50°C and plunged into a liquid at 100° C at time t = 0 gave the following e.m
    11·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!