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
aev [14]
4 years ago
6

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:
Aleonysh [2.5K]4 years ago
3 0

Answer:

sum = 0;for(j = 0; j < 7; j++)sum = sum + sales[5][j];

Explanation:

here we evaluate condition in parenthesis

sum = 0 here variable sum is initialised with 0 value

now for loop executes the condition in parenthesis which is (j = 0; j < 7; j++)

  • j =0 is 1st condition which will be executed one time , so j = 0 means index value for loop started is with 0 as you know arrays have index
  • j<7 2nd condition for executing the code block which defines loop will go on till the value of j is less than 7 ,as we know the columns in question is 7(this condition must be true)
  • j++ 3rd condition means after each iteration value of j will increase +1
  • here this condition is true (j = 0; j < 7; j++) till 7th column
  • sum = sum + sales[5][j]   (sales [row][column] it indicates every 5th row element of each column)

You might be interested in
Discuss the role of the concept behind the "Internet of Things (IoT)" in today's digitally connected society.
AlekseyPX

Answer:

IoT Definitions: The term Internet of Things generally refers to scenarios where network connectivity and computing capability extends to objects, sensors and everyday items not normally considered computers, allowing these devices to generate, exchange and consume data with minimal human intervention.

Explanation:

hope that helps

7 0
3 years ago
Read the following code:
sergejj [24]

Answer:

0

1

2

3

4

5

Explanation:

The loop first prints when n is still 0, so 0 is in the list.

The loop still executes when n = 5, so 5 must also be in the list.

6 0
3 years ago
In addition to MLA, what are some other widely used style guides? Check all that apply.
Lostsunrise [7]
APA and Chicago manual of style :D
6 0
3 years ago
Read 2 more answers
Sharing a workbook enables multiple users to access the workbook. What are the benefits of using a shared workbook?
damaskus [11]

Answer:

Some of the benefits of sharing a workbook include:

A. Shared information between students (ie: Mary writes a note about (blank) in the workbook and John reads said note and receives addition information about (blank)).

B. ^adding onto this, discussion on interpretations of a passage (ie: John thinks (blank) means this and Mary thinks (blank) means other thing, through notes they can discuss the meaning of the text.

Hope this helps. =)

8 0
4 years ago
Consider a sequence of 1's and 1's with the property that the sum of any prefix of the sequence is never negative For example th
MrMuchimi

Answer:

Check the explanation

Explanation:

Answer: Solution: Algorithm:

Step 1: Start.

Step 2: Create a stack Step

3: Push an initial stack variable, it will represent that, stack is empty.

Step 4: Get input

             If +1 then push "+1"

             Else if -1 then pop

Step 5: Repeat until all input finish or Stop if empty stack variable popped. Step 6: Stop.

It is a pushdown automata problem.

It can be also represented as:

X =1+1* —1* 1No(+1)>= No(-1)}

4 0
3 years ago
Other questions:
  • What practices will help you avoid sending out e-mail to the wrong person?
    15·1 answer
  • Consider the formula: G=D+(A+C^2)*E/(D+B)^3 Show the order that a processor would follow to calculate G. To do so, break down th
    10·1 answer
  • What table element represents a field within a record in powerpoint A column B Row C header D footer
    14·1 answer
  • The documents created in ms-excel is call what?​
    11·2 answers
  • A(n) ________ CPU has two processing paths, allowing it to process more than one instruction at a time. Group of answer choices
    5·1 answer
  • The process of identifying and removing logical errors and runtime errors is called ..............
    5·2 answers
  • HAIIIIIII ANYONE FEELING JOLLY OR SAD
    9·2 answers
  • Answer for 3 and 4 please
    15·2 answers
  • Display the desktop without minimizing or closing any windows.
    6·1 answer
  • What chage command should you use to set the password for jsmith to expire after 60 days and give a warning 10 days before it ex
    5·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!