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
16235 to the nearest ten thousand
masha68 [24]
16235 to the nearest ten thousand would be 20,000.

Hope this helps :)
~ Davinia.
7 0
4 years ago
Read 2 more answers
Fill in the blank: A keyword set to _____ match type will display your ad if the search term contains the same order of the word
jekas [21]

A keyword set to <u>Algorithm's</u> match type will display your ad if the search term contains the same order of the words, but it can also contain additional words. Negative phrase broad specific

<h3>What is Algorithms?</h3>

Algorithms, which are sequences of actions linked together to accomplish a task, operate in this direction – their goal is to give internet users this very specific information.

With this information, we can conclude which algorithm is the tool used to obtain specific information and make it available to the user.

Learn more about Internet in brainly.com/question/18543195

3 0
3 years ago
Give an example of a function from N to N that is: Hint: try using absolute value, floor, or ceiling for part (b). (a) one-to-on
Naily [24]

Answer:

Let f be a function  

a) f(n) = n²  

b) f(n) = n/2  

c) f(n) = 0  

Explanation:  

a) f(n) = n²  

This function is one-to-one function because the square of two different or distinct natural numbers cannot be equal.  

Let a and b are two elements both belong to N i.e. a ∈ N and b ∈ N. Then:

                               f(a) = f(b) ⇒ a² = b² ⇒ a = b  

The function f(n)= n² is not an onto function because not every natural number is a square of a natural number. This means that there is no other natural number that can be squared to result in that natural number.  For example 2 is a natural numbers but not a perfect square and also 24 is a natural number but not a perfect square.  

b) f(n) = n/2  

The above function example is an onto function because every natural number, let’s say n is a natural number that belongs to N, is the image of 2n. For example:

                               f(2n) = [2n/2] = n  

The above function is not one-to-one function because there are certain different natural numbers that have the same value or image. For example:  

When the value of n=1, then

                                  n/2 = [1/2] = [0.5] = 1  

When the value of n=2 then  

                                   n/2 = [2/2] = [1] = 1  

c) f(n) = 0

The above function is neither one-to-one nor onto. In order to depict that a function is not one-to-one there should be two elements in N having same image and the above example is not one to one because every integer has the same image.  The above function example is also not an onto function because every positive integer is not an image of any natural number.

5 0
3 years ago
Most internet connections use what transmission
Orlov [11]
Most internet connections use full-duplex transmissions. (Please give brainliest answer :) :D )
7 0
3 years ago
Read 2 more answers
My computer likes to disconnect every 3 or 5 minutes a lot when I turn it on, Is there any solution for this?
stira [4]

Answer:

RESTART IT!!! also check if its charged and look up problems with that model

Explanation:

5 0
3 years ago
Read 2 more answers
Other questions:
  • What is RAM? explain it
    9·2 answers
  • Those that work in the Printing Technology pathway are typically self-employed, and work indoors. self-employed, and work outdoo
    11·2 answers
  • Which of the following is not a main function within end user support?
    13·1 answer
  • Enter the cube's edge: 4<br> The surface area is 96 square units.<br> Python
    12·1 answer
  • What is the first thing you should do when troubleshooting a computer problem
    5·2 answers
  • Ethereum Mining Calculator Profitability and Difficulty Level?
    13·1 answer
  • I have a question. This question will probably be deleted, but why do moderators keep deleting my answers when they are legitima
    13·1 answer
  • Susan works for a company that values their employees me and deadlines in finding ways to keep the cost of doing business low wh
    12·1 answer
  • HELP ASAP!Select all examples of desirable workplace skills, habits, and attitudes.
    7·1 answer
  • Which principle or element of layout design is highlighted in this event poster?
    7·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!