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

what are some preventions and treatments for the listing below?
-Human papillomavirus
-Chlamydia
-Trichomoniasis
-Gonorrhea
-Syphilis
-HIV/AIDS

Answers

#1: Electrosurgery
#2: Antibiotics
#3: Treatment involves both partners taking one large dose of a certain oral antibiotic.
#4: Gonorrhea can be treated with antibiotics.
#5: Syphilis is treated with penicillin. Sexual partners should also be treated.
#6: HIV antiviral
Lastly: Are you okay?
Condoms help somewhat

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

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

A refrigerated space is maintained at -15℃, and cooling water is available at 30℃, the refrigerant is ammonia. The refrigeration capacity is 105 kJ/h. If the compressor is operated reversibly:

(1) What is the value of ε for Carnot refrigerator?

(2) Calculate the ε for the vapor-compression cycle;

(3) Calculate the circulation rate for the refrigerant;

(4) Calculate the rating power of the compressor.​

Answers

Answer:

(1) 5.74

(2) 5.09

(3) 3.05×10⁻⁵ kg/s

(4) 0.00573 kW

Explanation:

The parameters given are;

Working temperature, [tex]T_C[/tex]  = -15°C = 258.15 K

Temperature of the cooling water, [tex]T_H[/tex] = 30°C = 303.15 K

(1) The Carnot coefficient of performance is given as follows;

[tex]\gamma_{Max} = \dfrac{T_C}{T_H - T_C} = \dfrac{258.15}{303.15 - 258.15} = 5.74[/tex]

(2) For ammonia refrigerant, we have;

[tex]h_2 = h_g = 1466.3 \ kJ/kg[/tex]

[tex]h_3 = h_f = 322.42 \ kJ/kg[/tex]

[tex]h_4 = h_3 = h_f = 322.42 \ kJ/kg[/tex]

s₂ = s₁ = 4.9738 kJ/(kg·K)

0.4538 + x₁ × (5.5397 - 0.4538) = 4.9738

∴ x₁ = (4.9738 - 0.4538)/(5.5397 - 0.4538) = 0.89

[tex]h_1 = h_{f1} + x_1 \times h_{gf}[/tex]

h₁ = 111.66 + 0.89 × (1424.6 - 111.66) = 1278.5 kJ/kg

[tex]\gamma = \dfrac{h_1 - h_4}{h_2 - h_1}[/tex]

[tex]\gamma = \dfrac{1278.5 - 322.42}{1466.3 - 1278.5} = 5.09[/tex]

(3) The circulation rate is given by the mass flow rate, [tex]\dot m[/tex] as follows

[tex]\dot m = \dfrac{Refrigeration \ capacity}{Refrigeration \ effect \ per \ unit \ mass}[/tex]

The refrigeration capacity = 105 kJ/h

The refrigeration effect, Q = (h₁ - h₄) = (1278.5 - 322.42) = 956.08 kJ/kg

Therefore;

[tex]\dot m = \dfrac{105}{956.08} = 0.1098 \ kg/h[/tex]

[tex]\dot m[/tex] = 0.1098 kg/h = 0.1098/(60*60) = 3.05×10⁻⁵ kg/s

(4) The work done, W = (h₂ - h₁) = (1466.3 - 1278.5) = 187.8 kJ/kg

The rating power = Work done per second = W×[tex]\dot m[/tex]

∴ The rating power = 187.8 × 3.05×10⁻⁵ = 0.00573 kW.

What they said up there above me is true :)

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

In Florida, bike lanes are painted

Answers

Answer: green

Explanation:

The answer will be Green.!!

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

Luis is installing some 12 gage wire. How much resistance will there be throughout a distance of 400 feet

Answers

Answer:

0.635 m

Explanation:

When calculating the resistance R of a wire, we need  its length(l), its cross-sectional area (A) and the resistivity of the material(ρ). The resistance of a wire  is given by the equation:

Resistance (R) = Resistivity(ρ) × length (l) / cross-sectional area (A)

For a 12 guage wire,

Resistivity (ρ) = 1.724 × 10 ⁻⁸ ohm m, length (l) = 400 ft = 121.92 m,

Diameter (d) = 0.00205232, cross-sectional area (A) = πd²/4 = π(0.00205232)²/4 = 3.31 × 10 ⁻⁶ m²

[tex]R=\frac{\rho l}{A}=\frac{1.724*10^{-8}*121.92}{3.31*10^{-6}} =0.635m[/tex]

The answer is 0.635 m that’s the answer

Florida's No-Fault requires owners of motor vehicles must cover the
below minimum Personal Injury Liability (PIP) insurance coverage:
o $10,000 of Personal Injury Protection (PIP)
o $30,000 of Personal Injury Protection (PIP)
o $50,000 of Personal Injury Protection (PIP)
o $100,000 of Personal Injury Protection (PIP)

Answers

Answer:

The correct option is;

$10,000 of Personal Injury Protection (PIP)

Explanation:

Personal injury protection, PIP, otherwise known as No-Fault Law coverage is a part of auto insurance that takes care of medical cost of treatment of an accident victim regardless of who is at fault

In Florida, the No-Fault Law requires motor vehicle owners to have and retain PIP providing $10,000 in medical care, resulting disability and expenses of a funeral resulting from an accident in which the motorist is involved

Therefore, the correct option is $10,000 of Personal Injury Protection.

What they said^^^^^^^
Other Questions
HELP ASAP!!What is the surface area of a CUBE where the length of each edge is 4 feet?A) 12 feetB) 24 feetC) 64 feetD) 96 feet +18 ptsAn observer (O) spots a plane (P) taking off from a local airport and flying at a 33 angle horizontal to her line of sight and located directly above a tower (T). The observer also notices a bird (B) circling directly above her. If the distance from the plane(P) to the tower (T) is 7,000 feet, how far is the bird (B) from the plane (P)? Round to the nearest whole number.Help please ! Explain how each of these inventions helped to develop the country:automobileairplaneradio find the area of this figure to the nearest hundredth use 3.14 to approximate pi A=? ft squared Consider the following set of sample data.18 26 30 42 50 52 52 76 78 84For the given data, the mean is_______, the median is________, and the mode is_______. Suppose the value 76 in the data is mistakenly recorded as 55 instead of 76. For the sample with this error, the mean is_________, the median is______, and the mode is_______. The mean_____, the median_______, and the mode______. Suppose the value 76 in the original sample is inadvertently removed from the sample. For the sample with this value removed, the mean is_______, the median is_______, and the mode is________. The mean_________, the median_______, and the mode________. Heidee Corp. and Leaudy Corp. have identical assets, sales, interest rates paid on their debt, tax rates, and EBIT. However, Heidee uses more debt than Leaudy. Which of the following statements is CORRECT? A) Heidee would have the higher net income as shown on the income statement. B) Without more information, we cannot tell if Heidee or Leaudy would have a higher or lower net income. C) Heidee would have the lower equity multiplier for use in the Du Pont equation. D) Heidee would have to pay more in income taxes. E) Heidee would have the lower net income as shown on the income statement. Which of the following passages relates Equiano's reaction? a)...Not being used to the water, I naturally feared that element the first time I saw it b) Two of the white men offered me eatables; and, on my refusing to eat, one of them held me fast by the hands, and laid me across, I think, the windlass, and tied my feet c) "Then," said I, "how comes it in all our country we never heard of them?" d) During the rest of his voyage to the West Indies, Equino continued to endure hardships. Environmental pollution does not affect an individuals health. Please select the best answer from the choices provided T This one has really stumped me, if you could also explain how you got the answer (as well as the answer) that would be amazing! Thank you! What was an advantage of Constantinople's location? It lay near the geographic center of the Western Roman Empire. It did not need to build any defenses against an attack from the sea. It was close to the natural resources of Spain, Gaul, and Britain. It was situated on an important natural seafaring trade route. please Identify and explain 2 denial of powers of the state and national government? Which sentence demonstrates proper subject/verb agreement? A. Everybody in all the history classes want to see the monument.B. Everybody in all the history classes are wanting to see that monument.C. Everybody in all the history classes wants to see the monument. Solve the equation. 4c = 3 A study was conducted on the amount of time drivers wait for a stoplight to change at a particular intersection. The amount of time spent by 300 drivers was recorded and the resulting data were used to create boxplot.a. What is approximately the median amount of time spent at this traffic light? b. The top 25% of drivers waited at least how long? c. The mean amount of time spent at this traffic light was bigger or smaller than the median? Explain. The following account balances are taken from the December 31, 2018, financial statements of ABZ Advertising Company. The company uses accrual basis accounting. Advertising Revenue $ 46,482 Cash 41,516 Accounts Receivable 7,296 Interest Expense 2,299 Accounts Payable 5,000 Operating Expenses 37,460 Deferred Revenue 1,178 Equipment 18,048 Income Tax Expense 2,326 The following activities occurred in 2019: Performed advertising services on account, $55,000. Received cash payments on account, $10,400. Received deposits from customers for advertising services to be performed in 2020, $2,500. Made payments to suppliers on account, $5,000. Incurred $45,000 of operating expenses; $39,000 was paid in cash and $6,000 was on account and unpaid as of the end of the year. Which of the following is the journal entry that will be used to record activity #3? Multiple Choice Debit Cash and credit Accounts Receivable for $2,500. Debit Deferred Revenue and credit Advertising Revenue for $2,500. Debit Deferred Revenue and credit Receivable for $2,500. Debit Cash and credit Deferred Revenue for $2,500. The equation 8-4x=0 has how many real solutions what are 3 examples of social class in canada now What is the name of the body part that passes messagesfrom the sensory neurons to the brain?o LungsO Nerve Cellso Braino Stimulus please help me thanks how to ecosystem services affect human sustainability El prximo sbado, mis amigos y yo Iremos deal campo.O A. locinO B. seguroO C. excursinO D. burro