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
What does this function do in the code?
miskamm [114]

Answer:

Which part of the code??

Explanation:

5 0
3 years ago
Read 2 more answers
Which of the following is a good conductor of electricity and heat?
Zarrin [17]
The answer is A metal
7 0
2 years ago
Read 2 more answers
____ are designed to be used with everyday objects, such as home appliances, gaming consoles, digital cameras, e-readers, digita
Fudgin [204]

Embedded Operating Systems are designed to be used with everyday objects, such as home appliances, gaming consoles, digital cameras, e-readers, digital photo frames, ATMs, toys, watches, GPS systems, home medical devices, voting terminals, and cars.

6 0
3 years ago
A python programmer is writing a function definition. What syntax should be used?
Kay [80]

Answer:

<u>Syntax of function in the Python Programming Language.</u>

def function_name():

   '''body of the function or code'''

#calling of the function

function_name()

Note: In Python Programming Language, Indentation is sensitive if you not focus on the indentation then, you program occurs an indentation error.

Explanation:

In Python Programming language, we can use the "def" keyword to define a function then we write the name of the function and then use parentheses for the argument list. "#" is used for the single-line comment and " ''' ''' " is used for the multiple line comment.

A function is the part or module of the program which provides users the feature of reusability of that code anywhere only by calling them.

8 0
3 years ago
HOWARD!!!!!! THE PHONE IS RINGING!!!!!!!!!
777dan777 [17]

Answer:

i am confused

Explanation:

7 0
2 years ago
Read 2 more answers
Other questions:
  • 1- Design a brute-force algorithm for solving the problem below (provide pseudocode): You have a large container with storage si
    10·1 answer
  • In this problem we consider sending real-time voice from Host A to Host B over a packet-switched network (VoIP). Host A converts
    12·1 answer
  • Which of the following is the best definition of a workplace policy?
    13·2 answers
  • If your BAL is .10 you can expect a _______ drop in complex performance compared to the sober level
    6·1 answer
  • Write down the pseudo code of a program that calculates the Body Mass Index (BMI) of
    9·1 answer
  • What are the consequences of plagiarism?
    7·2 answers
  • Compare entertainment applications to social media applications.
    5·2 answers
  • If two egg cells are fertilized what will happen?
    10·1 answer
  • Which is NOT one of the basic characteristics of life? What feature of Microsoft
    5·1 answer
  • 236. A system such as a printer, smart TV, or HVAC controller, typically uses an operating system on what is called a:
    13·2 answers
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!