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

% Question{14}: Can be used as an alternative to an % if...elseif...else...end p

ID: 3861196 • Letter: #

Question

% Question{14}: Can be used as an alternative to an

% if...elseif...else...end pattern for handling multiple expressions.

Answer{14}='';

Reason{14}='';

% Question{15}: Used to navigate a two (or more) dimensional array where

% the goal is to display or access each element individually.

Answer{15}='';

Reason{15}='';

% Question{16}: Using the following, what is implied in the "else"?

% Grade = randi(100);

% if (Grade >= 90)

% Letter = 'A';

% elseif (Grade >=80)

% Letter = 'B';

% elseif (Grade >=70)

% Letter = 'C';

% elseif (Grade >= 60)

% Letter = 'D';

% else

% Letter = 'F';

% end;

% A. false

% B. The Grade may have been less than 60.

% C. The Grade may not have been a scalar number.

% D. The student should have worked more with Matlab.

% E. All of the above.

Answer{16}='';

Reason{16}='';

% Question{17}: Using the following, what item has not been identified?

% if (strcmpi( Color, 'blue' ))

% if (FilterSum <= 1000) % small

% % object identified...

% else % large

% % object identified...

% end;

% elseif (strcmpi( Color, 'yellow' ))

% if (FilterSum <= 1000) % small

% % object identified...

% else % large

% % object identified...

% end;

% else

% if (FilterSum <= 1000) % small

% % object identified...

% end;

% end;

% A. A small, yellow object

% B. A large, yellow object

% C. A small, green object

% D. A large, purple object

% E. A small, blue object

Answer{17}='';

Reason{17}='';

Explanation / Answer

Question{14}:

Answer{14}='switch statement';

Reason{14}='for minimizing the if-else statement.';

Question{15}:

Answer{15}='column index and row index';

Reason{15}=' it requires to locate an element in multidimensional array';

Question{16}:

Answer{16}=' B. The Grade may have been less than 60';

Reason{16}=' randi(100) returns a pseudorandom scalar integer between 1 and 100 and else only function if grade < 60';

Question{17}:

Answer{17}='D. A large, purple object';

Reason{17}='the else option checking for small';