Academic Integrity: tutoring, explanations, and feedback — we don’t complete graded work or submit on a student’s behalf.

Question 1. 1. (TCO 1) Assume you have the following declaration: int beta[50];

ID: 3547133 • Letter: Q

Question



Question 1.1. (TCO 1) Assume you have the following declaration:
int beta[50];
which of the following is a valid element of beta? (Points : 4)       beta['0']
      beta['1']
      beta[0]
      beta[50]

Question 2.2. (TCO 1) What is the value of alpha[3] after the following code executes?

int alpha[5] = {0};
int j;
alpha[0] = 5;
for (j = 1; j < 5; j++)
{
     if (j % 2 == 0) //see if j is an odd number
          alpha[j] = alpha[j - 1] + 2;
     else
          alpha[j] = alpha[j - 1] + 3;
} (Points : 4)       10
      13
      15
      17

Question 3.3. (TCO 1) What is stored in alpha after the following code executes?

int alpha[5] = {0};
int j;
for (j = 0; j < 5; j++)
{
     alpha[j] = j + 1;
     if (j > 2)
         alpha[j - 1] = alpha[j] + 2;
} (Points : 4)       alpha = {1, 2, 6, 7, 5}
      alpha = {1, 2, 3, 4, 5}
      alpha = {4, 5, 6, 7, 9}
      None of these

Question 4.4. (TCO 1) Suppose that the array alpha is to be declared as a formal parameter in a function heading. Which of the following about alpha is true?
(i) You must specify the size of alpha in square brackets.
(ii) You cannot pass alpha by value. (Points : 4)       Only (i)
      Only (ii)
      Both (i) and (ii)
      Neither of these

Question 5.5. (TCO 1) Consider the following statement:
double alpha[10][5];
The number of components of alpha is _____. (Points : 4)       15
      50
      100
      150

Question 6.6. (TCO 1) Which of the following correctly declares and initializes alpha to be an array of four rows and three columns with the component type int? (Points : 4)       int alpha[4][3] = {{0,1,2} {1,2,3} {2,3,4} {3,4,5}};
      int alpha[4][3] = {0,1,2; 1,2,3; 2,3,4; 3,4,5};
      int alpha[4][3] = {0,1,2: 1,2,3: 2,3,4: 3,4,5};
      int alpha[4][3] = {{0,1,2}, {1,2,3}, {2,3,4}, {3,4,5}};

Question 7.7. (TCO 1) Consider the following statements.
int alpha[10][5] = {0};
int j,k;
Which of the following statements correctly initializes alpha to 0?

(i)
for (j = 0; j < 10; j++)
     for(k = 0; k < 5; k++)
         alpha[j][k] = 0;
(ii)
for (k = 0; k < 5; k++)
     for (j = 0; j < 10; j++)
         alpha[j][k] = 0; (Points : 4)       Only (i)
      Only (ii)
      Both (i) and (ii)
      None of these

Question 8.8. (TCO 1) Considering the following statement:
double alpha[10][5];
what is the last row and column element of the array? (Points : 4)       alpha[10][5]
      alpha[9][4]
      alpha[10][4]
      alpha[9][5]

Question 9.9. (TCO 2) A class is an example of (Points : 4)       a structured data type.
      an unstructured data type.
      a simple data type.
      primitive data.

Question 10.10. (TCO 2) In a class, all function members (Points : 4)       must be public and all member variables must be private.
      must be public and all member variables must be public also.
      and member variables can be either public or private.
      must be private and all member variables must be public.





Question 1.1. (TCO 1) Assume you have the following declaration:
int beta[50];
which of the following is a valid element of beta? (Points : 4)       beta['0']
      beta['1']
      beta[0]
      beta[50]

Question 2.2. (TCO 1) What is the value of alpha[3] after the following code executes?

int alpha[5] = {0};
int j;
alpha[0] = 5;
for (j = 1; j < 5; j++)
{
     if (j % 2 == 0) //see if j is an odd number
          alpha[j] = alpha[j - 1] + 2;
     else
          alpha[j] = alpha[j - 1] + 3;
} (Points : 4)       10
      13
      15
      17

Question 3.3. (TCO 1) What is stored in alpha after the following code executes?

int alpha[5] = {0};
int j;
for (j = 0; j < 5; j++)
{
     alpha[j] = j + 1;
     if (j > 2)
         alpha[j - 1] = alpha[j] + 2;
} (Points : 4)       alpha = {1, 2, 6, 7, 5}
      alpha = {1, 2, 3, 4, 5}
      alpha = {4, 5, 6, 7, 9}
      None of these

Question 4.4. (TCO 1) Suppose that the array alpha is to be declared as a formal parameter in a function heading. Which of the following about alpha is true?
(i) You must specify the size of alpha in square brackets.
(ii) You cannot pass alpha by value. (Points : 4)       Only (i)
      Only (ii)
      Both (i) and (ii)
      Neither of these

Question 5.5. (TCO 1) Consider the following statement:
double alpha[10][5];
The number of components of alpha is _____. (Points : 4)       15
      50
      100
      150

Question 6.6. (TCO 1) Which of the following correctly declares and initializes alpha to be an array of four rows and three columns with the component type int? (Points : 4)       int alpha[4][3] = {{0,1,2} {1,2,3} {2,3,4} {3,4,5}};
      int alpha[4][3] = {0,1,2; 1,2,3; 2,3,4; 3,4,5};
      int alpha[4][3] = {0,1,2: 1,2,3: 2,3,4: 3,4,5};
      int alpha[4][3] = {{0,1,2}, {1,2,3}, {2,3,4}, {3,4,5}};

Question 7.7. (TCO 1) Consider the following statements.
int alpha[10][5] = {0};
int j,k;
Which of the following statements correctly initializes alpha to 0?

(i)
for (j = 0; j < 10; j++)
     for(k = 0; k < 5; k++)
         alpha[j][k] = 0;
(ii)
for (k = 0; k < 5; k++)
     for (j = 0; j < 10; j++)
         alpha[j][k] = 0; (Points : 4)       Only (i)
      Only (ii)
      Both (i) and (ii)
      None of these

Question 8.8. (TCO 1) Considering the following statement:
double alpha[10][5];
what is the last row and column element of the array? (Points : 4)       alpha[10][5]
      alpha[9][4]
      alpha[10][4]
      alpha[9][5]

Question 9.9. (TCO 2) A class is an example of (Points : 4)       a structured data type.
      an unstructured data type.
      a simple data type.
      primitive data.

Question 10.10. (TCO 2) In a class, all function members (Points : 4)       must be public and all member variables must be private.
      must be public and all member variables must be public also.
      and member variables can be either public or private.
      must be private and all member variables must be public.

Explanation / Answer

beta[0]
13
alpha = {1, 2, 6, 7, 5}
Neither of these

50
int alpha[4][3] = {{0,1,2}, {1,2,3}, {2,3,4}, {3,4,5}};
Both (i) and (ii)
alpha[9][4]
a structured data type.

must be public and all member variables must be private.

Hire Me For All Your Tutoring Needs
Integrity-first tutoring: clear explanations, guidance, and feedback.
Drop an Email at
drjack9650@gmail.com
Chat Now And Get Quote