Create a class OperateArray in which you create a 2 x 3 integer array with all zeros in it. Allow the user to traverse the array to enter the 6 values in the array. The user will fill in the top row first, then the bottom row. The class should then subtract the bottom number from the top number in each column, and then add the results of the 3 subtractions to get a total. Enter the data shown below
| 6 5 4| Top row of array
|3 2 3| Bottom row of array
The correct answer is 7.

Answers

Answer 1

Answer:

The programming language is not stated; however, I'll answer this question using Java programming language.

Because of the length of the program, comments are used to explain some lines

See Attachment for program file

Program starts here

import java.util.*;

public class OperateArray{

public static void main(String [] args)

{

 Scanner input = new Scanner(System.in);

 //Declare Array

 int arr[][] = new int[2][3];

 //Fill array with 0

 for(int row =0;row<2;row++)

 {

  for(int col=0;col<3;col++)

  {

   arr[row][col] = 0;

  }

 }

 //Prompt user for input

 for(int row =0;row<2;row++)

 {

  if(row == 0)

  {

   System.out.print("Enter top rows\n"); //Top rows

  }

  else

  {

   System.out.print("Enter bottom rows\n"); //Bottom Rows

  }

  for(int col=0;col<3;col++)

  {

   arr[row][col] = input.nextInt();

  }

 }

 //Initialize difference to 0

 int diff = 0;

 //Print and Calculate Difference

 for(int row =0;row<2;row++)

 {

  for(int col=0;col<3;col++)

  {

   if(row<1)

   {

   if(col<2)

   {

    System.out.print(arr[row][col]+" ");

   }

   else

   {

    System.out.print(arr[row][col]+" |Top Row of Array\n");

   }

   //Add top rows

   diff+=arr[row][col];

   }

   else

   {

    if(col<2)

   {

    System.out.print(arr[row][col]+" ");

   }

   else

   {

    System.out.print(arr[row][col]+" |Bottom Row of Array\n");

   }

   //Subtract bottom rows from top

   diff-=arr[row][col];

   }

  }

 }

 //Print Difference

 System.out.print("Difference: "+diff);

}

}

//End of Program

Answer 2
It is the top row so it is 7

Related Questions

1. Unauthorized persons servicing equipment may jeopardize the safety of operators and
others due to ___ of heavy equipment.
a. mechanical failure
b. incorrect classification
C. improper signaling
d. electrical designation

Answers

c. improper signaling
C. improper signaling. i know cause i just took this test

What classes I have to take before joining the lineman program?

Answers

Answer:

have a high school diploma or GED certificate, and submit an application to your local Joint Apprenticeship Training Committee (JATC). Some JATCs have additional requirements: a grade of C or better in algebra and a commercial driver's license.

Answer:

GED and a JATC

Explanation:

The CountLetters application is limited to counting letters in a single word. Modify the CountLetters application to count the letters in an entire phrase, which contains spaces. Care must be taken to ignore the spaces and any other non alphabetic character found in the phrase. Be sure to change comments and variable names appropriately so that the reader of the application code understands that the letters in a phrase are counted.


import java.util.Scanner;

public class CountLetters {

public static void main(String[] args) {
final int LOW = 'A'; //smallest possible value
final int HIGH = 'Z'; //highest possible value
int[] letterCounts = new int[HIGH - LOW + 1];
Scanner input = new Scanner(System.in);
String phrase;
char[] wordLetters;
int offset; //array index

/* prompt user for a phrase */
System.out.print("Enter a phrase: ");
phrase = input.nextLine();
input.close();

/* convert word to char array and count letter occurrences */
phrase = phrase.toUpperCase();
wordLetters = phrase.toCharArray();
for (int letter = 0; letter < wordLetters.length; letter++) {
offset = wordLetters[letter] - LOW;
letterCounts[offset] += 1;
}

/* show letter occurrences */
for (int i = LOW; i <= HIGH; i++) {
System.out.println((char)i + ": " + letterCounts[i - LOW]);
}
}

}


Answers

what are you trying to say here? do you need help? Or ..?
You can’t put it lines of code like that it’s not that easy to figure out what your trying to say in Java script

The practice of honoring those who have been lost in battle dates back to which two ancient
civilizations?

Answers

It was between Iranians and filapinons nice work man it’s easy
Indus River valley civilizations I don’t really know anymore on the top of my headache

BE-27 In regard to waste management laws, a boat of what length or greater (in feet) is required to have an oil discharge
placard posted?
20
22
24
26

Answers

Answer: 26 feet

Explanation:

Federal law requires that when a boat of 26ft or more is on lakes, rivers, or in the ocean 3 miles from shore, it should "prominently posted" placards about garbage as well as Oil Discharges stating that oil discharges are not allowed as well as what materials can and are prohibited from being thrown from the boat into the water.

Both placards should be permanently attached with a minimum size of 5*9 inches and made entirely of durable material.

I have attached an example of the placard.

Your answer would be 22

Explanation:




1. If the correct precautions are not taken, working on automobiles can be

Answers

Difficult/ close to impossible
May cause many accidents, they may fire u from the job

On January 19, 2006, NASA launched the New Horizons mission toward Pluto; the probe
passed by Pluto on July 14, 2015, roughly 9.5 years later. Given your answers to the last
two question, on average how fast must the New Horizons probe have been traveling?

Answers

Answer:

58,536 km

Explanation:

Answer: 58,536 km

Explanation:

Which of the following will help sober up and lower the BAL of an intoxicated person? Exercise Black coffee Time A cold shower

Answers

Where are the following to these questions ?

Answer:

Time

Explanation: time gives the liver the chance to do its job and metabolize the alcohol. Although...exercise can help wake up the body and make a person more alert. It may also help metabolize alcohol more quickly, although the scientific evidence of this is inconclusive.

Pure ethanol has an octane rating of about 113. E85, Which contains 35 percent oxygen by weight, has an octane rating of about

Answers

The octane rating for E15 (15% ethanol) is 88 octane and E85 (85% ethanol) is 108 octane. In addition, as Argonne National Laboratory states, ethanol reduces greenhouse gas emissions between 34 to 44 percent compared to gasoline.
108 octane is the correct or best anwser it is very close


Given half a chance, other people at work will take advantage of you.

Answers

Answer:

T

Explanation:

True

Yes they will
Some people will thank you for the opportunity given
Mostly people won’t care ,they’ll use u when they need u and ignore u after that
So ,u better make full use of it

What is one way a C47 can be used on set?

Answers

Answer:

C47 may seem like a fancy word, but in the film world, it is the name of one of the simplest, most useful and versatile tools, which is commonly knows as a clothespin.

Following are major uses of C47 on a film set.

1) Lightning Purposes

C47 are used for attaching materials like gel and diffusion to the adjustable flaps, that control the direction of light

2) Adjusting Wardrobes

C47 are used to shorten, tighten or redesign a material of clothing for a specific purpose. It avoids permanent change and the hassle of sewing.

3) Modifications

These can be used for temporary repairs or to modify the set and shooting locations, e.g if a curtain is not hanging properly, C47 can be used

It transfers military men

What type of damage is reduced by installing impact resistant glass functional shutters and double door top and bottom latches

Answers

Answer: you are reducing bullet damage or the damage of a person getting shattered glass all over them

Explanation: i dont

have one

Hinges will out weigh the needed amount

Which option identifies the technology that controlled flooding in the following scenario? The Nile River in Egypt floods its banks from melting snow and heavy rains every year. Since 1970, flood control has been managed by the Aswan High Dam. terps locks polders sluice gates HELP PLEASE

Answers

Answer:

The correct option is;

Since 1970, flood control has been managed by the Aswan High Dam

Explanation:

The scenario that identifies the technology that controlled flooding is the flood control that is being managed by the Aswan High Dam

Dams alongside their reservoirs are meant control the flow water and to protect low-lying areas from disastrous floods. Damming a water way involves the construction of a standardized dam complementary standard water reservoir with the water within it being kept below a certain level to allow it accommodate water coming from floods.

Terps are artificial mounds meant for dwelling

Polders are water body reclaimed low-lying land by the construction of drainage canals and d y k e s

Sluice gates are meant to harness the power of flowing waters.

The correct option is; Since 1970, flood control has been managed by the Aswan High Dam
Other Questions
A set of numbers is said to be COMMUTATIVE under the operation '+' if m + n = n + m, for any two numbers m and n of that set. Similarly, a set of numbers is said to be COMMUTATIVE under the operation '' if m n = n m.Which of the following sets is COMMUTATIVE under the operation '-'?A)the set of integersB)the set of natural numbersC)the set of rational numbers D)none of the above Rewrite the function by completing the squaref(x) = 2x^2+3x-2f(x)= ____ (x+___)^2+____ PLZ HELP I CAN'T FAIL!!!I did not appreciate the three hour lecture we had to sit through after being late for curfew.Which phrase in the sentence should be hyphenated? A. three hour B. hour lecture C. late for curfew D. sit through after Which of the following is equivalent to 0.0009?A 0.0009%B 0.009%C 0.09%D 0.9% What is the name of the substance that a transported sediment moves through?A. FluidB MediumC. GlacierD. Erosion HELP, NEED ANSWER ASAP, PLEASE, IM WORKING ON TRIANGLES AND I DONT GET IT Thomas Paines Common Sense pushed for a more radical solution than theFirst Continental Congress did in resolving issues of British rule. What was Paines solution which statement best describes how genes are able to produce a organism's traits? if a car cover a distance of 189km in 4.5 hours, what is it average speed? If there are 3 ft in 1 yd, which of the following are possible conversion factors for feet and yards? Check all that apply Two boxes need to be moved into storage. Jamal and Jude each want to move a box. The force of gravity on both the boxes is 50 N. Jamal is lifting with a force of 60 N, and Jude is lifting with a force of 45 N. Which best describes the movement of the boxes? Jamal moved his box to storage, but Jude could not move his. Jamal and Jude can successfully move each box into storage. Jamal could not move his box to storage, but Jude could. Neither Jamal nor Jude could move the boxes into storage. Which of the following points does not lie in the solution set to the inequality y = 1/3x + 5?A) (6,3)C) (-3,8)D) (12,3)B is wrong What is the length of the side opposite ZB?3 units4 units5 units6 units 30.Which of the sentences below uses a fronted adverb? 1.Spurned, he turned on his heel and strutted off. 2.Surrepticiously, Peter glanced at his watch. 3.Glaring, he hoped the problem would go away. Isabel is creating a wireframe she has drawn a layout for the home page along with outlining the navigation elements she now wants to represent content and a banner for the home page what should she use? Isabel should use (???) to show where the content and banner will go Use the distributive property to write the following expression without parentheses.-3/5(20x-20y) A 1.2 m steel rod moves through a uniform magnetic field of 0.020 T at 30 m/s. What emfis induced between the two ends of the steel rod?0.36 V0.50 V0.60 V0.72 V Will mark brainlyest with 50 points and 4 thank you'sThree children are having a Birthday Party. Can you work out how many candles need to go on each cake? Read the clues and show your work. Clue 1: Maya and Josh have 20 candlesClue 2: Maya and Sam have 13 candles Clue 3: Sam and Josh have 15 candlesClue 4: There are 24 candles altogether. How many candles are on Mayas cake?How many candles are on Joshs cake?How many candles are on Sams cake? Which method would you use to prove that the two triangles are congruent?SSSAASSASASA The chart shows the marginal revenue of producing apple pies. A 3-column table titled The return on pie production has 8 rows. The first column is labeled Pies produced per day with entries 0, 1, 2, 3, 4, 5, 6, 7. The second column is labeled Total revenue with entries blank, 10, 20, 30, 40, 50, 60, 70. The third column is labeled Marginal revenue with entries blank, 10, 10, 10, 10, 10, 10, 10. According to the chart, the marginal revenue decreases by ten dollars as production increases. increases by ten dollars as production increases. falls to zero dollars as production increases. remains the same as production increases.