Question: Create flowchart of code from if else statements Using the weather example from class using nested if % statements, create a flowchart illustrating the flow
Create flowchart of code from if else statements
Using the weather example from class using nested if
% statements, create a flowchart illustrating the flow of the code from the
% starting problem ('What to take with me.') to each of the four possible
% end points. Use https://en.wikipedia.org/wiki/Flowchart as a guide but
% note that you will have four end points, not three.
Temperature = 35;
IsRaining = true;
if (Temperature < 40)
% it is cold outside
if (IsRaining == true)
% it is raining
% it is cold and it is raining. --> trenchcoat
Item = 'trenchcoat';
else
% not raining
% it is cold but not raining. --> jacket
Item = 'jacket';
end;
else
% it is ok (not cold)
if (IsRaining == true)
% it is raining
% it is not cold and raining --> umbrella
Item = 'umbrella';
else
% it is not raining
% it is not cold and not raining --> shorts
Item = 'shorts';
end;
end;
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
