(Help The Programmer) : Present Iterations (Wrong)
(Help The Programmer) : Present Iterations (Wrong)
0 out of 2 points
In nested loops, the continue statement, if present within a nested if structure, will exit the ____________
• Question 4 (True)
2 out of 2 points
A function can be called several times by placing a function call in the body of a for loop.
• Question 7 (5040)
4 out of 4 points
If the genearted random value for variable num = 7, what will be the ouput of this code? _____
• Question 8 – parentheses()
2 out of 2 points
The condition of a while loop can be written inside _____.
• Question 9 (x>0&&x<5)
2 out of 2 points
What is the correct Matlab expression for checking to see if a number stored in a variable x is between 0
and 5.
function hello( )
fprintf("Hello \n");
end
• Question 12 (false)
2 out of 2 points
Local variables can be referenced outside of the function they were defined in.
for w = 1: 10
accum = 0;
accum = accum + w;
end
disp(accum);
What happens if you put the initialization of accum inside the for loop as the first instruction in the loop?
• Question 14 (row)
2 out of 2 points
In a nested loop, outer loop represents what?
I.
if x < 0
disp("The negative
number " + x + " is
not valid here.");
else (x > 0)
disp(x + " is a
positive number");
else
disp(x + " is 0");
end
II.
if x < 0
disp("The negative number " + x + " is not valid here.");
elseif (x > 0)
disp(x + " is a positive number");
else
disp(x + " is 0");
end
III.
if x < 0
disp("The negative number " + x + " is not valid here.");
end
if x > 0
disp(x + " is a positive number");
else
disp(x + " is 0");
end
• Question 16 (a number)
2 out of 2 points
The number of iterations run for any loop by MATLAB is always _____________
• Question 19 (column)
2 out of 2 points
Copy of
• Question 20 (true)
2 out of 2 points
While running a loop in MATLAB, it does not require indentation.