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
Alla [95]
3 years ago
5

Write a function called getRowTotal. This function should accept a two-dimensional int array as its first parameter (the array h

as 5 columns) and an integer as its second parameter. The second parameter should be the subscript of a row in the array. The function should return the total of the values in the specified row. Only write the function no need to write the main function
Computers and Technology
1 answer:
garik1379 [7]3 years ago
8 0

Answer:

The solution is implemented using C++

int getRowTotal(int a[][5], int row) {

  int sum = 0;

  for(int i =0;i<5;i++)

  {

      sum += a[row][i];

  }

  return sum;

}

Explanation:

This defines the getRow function and the parameters are arr (the 2 d array) and row and integer variable

int getRowTotal(int arr[][5], int row) {

This defines and initializes sum to 0

  int sum = 0;

This iterates through the row and adds the row items

<em>   for(int i =0;i<5;i++)    { </em>

<em>       sum += arr[row][i]; </em>

<em>   } </em>

This returns the calculated sum

  return sum;

}

You might be interested in
if i were to buy one of these and plug it into a ps4 usb slot would i be able to see it on a tv? cause my hdmi slot on the ps4 i
alisha [4.7K]
It should work unless you did or bought the wrong thing
7 0
3 years ago
Read 2 more answers
Consider the following declaration: (1, 2) double currentBalance[91]; In this declaration, identify the following: a. The array
Rom4ik [11]

Answer:

Following are the solution to the given choices:

Explanation:

Given:

double currentBalance[91];//defining a double array  

In point a:  

The name of the array is= currentBalance.  

In point b:  

91 double values could be saved in the array. It requires 8bytes to hold a double that if the array size is 91*8 = 728

In point c:  

Each element's data type is double.

In point d:  

The array index range of values is between 0 and 90 (every array index starts from 0 and ends in N-1, here N=91).  

In point e:  

To access first element use currentBalance[0], for middle currentBalance[91/2] , for last currentBalance[90]

3 0
3 years ago
PLEASE ILL MARK BRAINLIEST
Minchanka [31]

Answer:

it is a capsid

5 0
3 years ago
The instruction format of a computer is given by one indirect bit, opcode bits, register address bits, immediate operand bits an
oksian1 [2.3K]

Answer:

Following are the answer to this question:

Explanation:

A)

The memory size is 1 Giga Bytes which is equal to 2^{30}

\texttt{Number of address bits    \ \ \ \ \ \ \ \ \ \ \ \ \ \            Number of addresses}\\\\ \ \ \ \ 30  \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \  \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \                                 2^{30}= 1073741824

B) \texttt{I \ \ \ Opcode  \ \ \ Register address \ \ \  Immediate operand \ \ \    Memory address}\\\\\\\textt{1 \ bit  \  \ \ \ \ \ 128  \ \ \ \ \ \ \ \ \ \ \ \ \ \ \    2 \ bits   \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \   24 \ bits  \ \ \ \ \ \ \ \ \ \ \ \ \ \ \  \ \ \ \ \ \ \ \ \           30 \ bits}\\\\\\            = 2^7 \\\\ = 7 \ bits

calculating the register Bits:

= 64-(1+7+24+30)\\\\=64 -62\ \  bits\\\\= 2\ \ bits\\

C)

Immediate value size while merging the additional benefit with the address field:

= 2^{24} + 2^{30}\\\\= 2^{54}\\\\\texttt{Range before combining(-,+) 24 bits   \ \ \ \ \ \       Range after combining( -,+)54bits}\\\\                         \textt{-2^{12} from + (2^{12}-1)   \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \                                    -2^{27} from + (2^{27}- 1)}

= \frac{24}{2} = 12\\\\= \frac{54}{2} = 27

The range is accomplished by dividing the bits by 2 into the two sides of the o and the number is one short to 0.

8 0
3 years ago
Write an algorithm to calculate the sum of three numbers A, B and C​
kati45 [8]

Answer:

1. Start

2. Display "Enter three numbers"

3. Input A

4. Input B

5. Input C

6. Sum = A + B + C

7. Display Sum

8. Stop

Explanation:

Line 1 and Line 7 of the algorithm implies the start and end of the algorithm, respectively.

Line 2 prompts user for input of three numbers

Line 3 to 5 accept input from user and these inputs are saved in variables A, B and C

Line 6 adds the three inputs and saves the result in variable Sum

Line 7 displays the value of Sum

6 0
4 years ago
Other questions:
  • If all of Earth's history were squeezed into one 12-hour period, how long ago did Precambrian time end? How long did the Cenozoi
    15·1 answer
  • These statements describe the NOS.(choose all that applies)
    13·2 answers
  • Implement the following logic in C++, Use appropriate data types. Data types are represented as either numeric (num) or string.
    5·1 answer
  • An error condition consisting of an error in the passing of parameters -- a method passes or returns an unexpected value such as
    12·1 answer
  • Have you searched Buzz Ch.at on playstore​
    13·1 answer
  • What descriptions can be used for last,first,PR_ID and CID
    8·1 answer
  • What game is this? help mee?
    8·2 answers
  • Describe how you will lunch a web browser using the start menu​
    6·2 answers
  • The BCD number for decimal 473 is( ). a) 111011010; b) 010011110011; c) 010001110011; d)0010110110​
    15·1 answer
  • Diferencias entre ciencia y tecnologia
    5·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!