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
Which function converts the user's input to a number with a decimal?
levacccp [35]

Answer:

Explanation: integer is the meaning of int() if you payed attention to programming class, int() would be a WHOLE number and not a decimal number, 2nd of all, a decimal number would be float() so the answer is int() hope i helped!

Explanation:

hope this helped good luck

4 0
3 years ago
What considerations have to be kept in mind with JPEG
topjm [15]
JPEG is a file format for an image that will be compressed. Since it compressed the file size will be much smaller. That makes JPEG is one of the most used file types for images and was a default format for many application. But the drawback of compressing an image is that a portion of the data will lose and will cause the image quality dropped or produce a noise.
8 0
4 years ago
The a0 is the part of the central processing unit that performs arithmetic calculations for the computer.
Serga [27]

Answer:

It is the ALU or the Arithmetic Logic Unit.

Explanation:

It is the ALU. However, keep in mind that registers and buses do a very important task. The number of registers we have, faster is the processing, and the opposite is true as well. And there is a reason behind this if we have different channels for sending and receiving the data from the memory, and several registers for storing the data, and we can formulate the requirement seeing the requirements for full adder and half adders. Remember we need to store several variables in case of the full adder, and which is the carry, and if we have separate registers for each of them, our task becomes easier. Remember its the CU that tells the ALU what operation is required to be performed. Also remember we have the same channel for input and output in the case of Van Neumann architecture, as we have a single bus. and we also have a single shared memory. And Harvard architecture is an advanced version of it.

6 0
3 years ago
Which is a gallery of pr design pictures that can be inserted directly in the document​
fredd [130]

Answer:

.,.,.,.,.,.,.,.,.,.,.,.,.

6 0
3 years ago
4.12 LAB: Using math methods Given three floating-point numbers x, y, and z, output x to the power of z, x to the power of (y to
Greeley [361]

Answer:

The function is as follows:

import math

def func(x,y,z):

   print(math.pow(x, z))

   print(math.pow(x,math.pow(y, z)))

   print(math.fabs(y))

   print(math.sqrt(math.pow(x*y,z)))

Explanation:

This imports the math library

import math

This defines the function

def func(x,y,z):

Print the stated outputs as it is in the question

<em>    print(math.pow(x, z)) ---> x to power x</em>

<em>    print(math.pow(x,math.pow(y, z))) ---- x to power of y of z</em>

<em>    print(math.fabs(y)) ---- absolute of y</em>

<em>    print(math.sqrt(math.pow(x*y,z))) --- square root of xy power x</em>

<em />

4 0
3 years ago
Other questions:
  • Travis completes his assignments on a word processor. He wants to make sure that his documents are free from spelling or grammat
    9·2 answers
  • Operating systems that have windows and icons have which type of user interface?
    15·1 answer
  • What are the chief contributions of philosophy to artificial intelligence?
    13·1 answer
  • X = 19 y = 5 print (x % y)
    11·1 answer
  • Because floating points have decimals, they're more precise and take up more memory than integers.
    6·1 answer
  • Consider the following code: String word [] = {"algorithm", "boolean", "char", "double"}; for ( int i =0; i &lt; word.length/2;
    11·2 answers
  • A final class can't be extended.<br><br> *True<br><br> *False
    9·1 answer
  • Write an application that displays the sizes of the files lyric1.txt and lyric2.txt in bytes as well as the ratio of their sizes
    15·1 answer
  • Which format has the largest file size?
    10·1 answer
  • What does a companys code of ethics cover
    8·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!