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
Serjik [45]
3 years ago
9

Suppose that sales is a two-dimensional array of 10 rows and 7 columns wherein each component is of the type int , and sum and j

are int variables. Which of the following correctly finds the sum of the elements of the fifth row of sales?1. sum = 0;for(j = 0; j < 10; j++)sum = sum + sales[5][j];2. sum = 0;for(j = 0; j < 7; j++)sum = sum + sales[4][j];3. sum = 0;for(j = 0; j < 10; j++)sum = sum + sales[4][j];4. sum = 0;for(j = 0; j < 7; j++)sum = sum + sales[5][j];
Computers and Technology
1 answer:
Deffense [45]3 years ago
3 0

According to the given question, sales is a two-dimensional array and contains 10 rows and 7 columns wherein each component is of type integer and the variables sum and j are also of integer type.

<u>Explanation:</u>

In order to find the sum of the elements of the fifth row of sales, the correct piece of code should be:

sum=0;

for(j=0;j<7;j++)

sum=sum+sales[4][j];  

The indexing in an array always starts from zero, therefore, to calculate the sum of the fifth row, the user has to write 4 in the index to point to the fifth row.

You might be interested in
(in PYTHON) Write a function in REPL.it that uses three parameters, and squares the first, calculates mod 5 of the second parame
tatiyna

Answer:

I wrote this myself, it should be working. I think this is what the instructions were looking for.

The code below should return

Squared: 1296  

Mod: 0        

Quadrupled: 16

Explanation:

def threeParams(squared, mod, quadruples):

   array = [squared, mod, quadruples]

   array[0] = squared ** 2

   array[1] = mod % 5

   array[2] = quadruples * 4

   return array

valueArr = threeParams(36, 15, 4)

print(f"Squared: {valueArr[0]}\nMod: {valueArr[1]}\nQuadrupled: {valueArr[2]}")

4 0
3 years ago
PLZZZZZZZZ HURRY What is FireWire?
ycow [4]

Answer:C

Explanation:

7 0
3 years ago
Read 2 more answers
Forwarded events can only be recorded when systems ADMINISTRATORS have de-established an event subscription. TRUE or FALSE
weeeeeb [17]

Answer:

True

Explanation:

Forwarded events can only be recorded when systems administrators have de-established an event subscription.

8 0
3 years ago
According to the 2014 Pew Research Center analysis of U.S. census data, 84% of U.S. households own a(n) __________.
olga_2 [115]
Computer. :) 73% have a computer with a broadband connection to the internet, if you need that info too. 
4 0
3 years ago
Read 2 more answers
Which of the following characters cannot be used in a filename?
kondaur [170]
I think Backslash, if I'm not mistaken.
3 0
3 years ago
Read 2 more answers
Other questions:
  • What is the device called which typically combines the capabilities of a scanner, printer, fax, and copying machine?
    15·1 answer
  • RDBMS stands for_________________
    12·1 answer
  • ________ is installed into special, read-only memory of devices like printers and print servers or devices used for various type
    13·1 answer
  • Give two reasons why cloud computing could be detrimental to a company.
    15·1 answer
  • How do i install windows 7 on virtual machine?​
    9·1 answer
  • Which of the following situations would not require knowledge of networking?
    11·2 answers
  • If you misspell a word in your Java program it may be true that I. the program will not compile II. the program may compile, but
    6·1 answer
  • I re-made the human version of Daddy Dearest from Friday Night Funkin
    14·2 answers
  • Hiya people. I am a game developer and I need an idea for a new game. If you have any ideas, pls feel free to tell me. Best idea
    6·2 answers
  • How to mark a discussion as read on canvas dashboard.
    10·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!