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

do I assign anything to checkrange? number in range) Problem Description The tes

ID: 3792252 • Letter: D

Question


do I assign anything to checkrange?

number in range) Problem Description The test suite generates a random number and assigns it to the variable RandomNumber. Write a script that checks if the value assigned to RandomNumber is between 0 and 10 (consider values of exactly 0 and exactly 10 to be in range). If the value is in this range assign the string "The number is in range." to the variable CheckRange. If the value is not in this range, assign the string "The number is out of range." to the variable CheckRange. #CHAR Solution ATI AB w e r t y u i o p a s d f g h j k x c v b n m L

Explanation / Answer

%matlab code

% random number generation
RandomNumber = randi(100);

Checkrange = "";

if RandomNumber >= 0 && RandomNumber <= 10
Checkrange = "The number is in rangle";
else
Checkrange = "The number is out of range";
end

fprintf("Random Number: %d ",RandomNumber);
disp(Checkrange);


%{
output:

Random Number: 19   
The number is out of range

%}