computer scienceThe Beaufort Wind Scale is used to characterize the strength of winds. The scale uses integer values and goes from a force of 0, which is no wind, up to 12, which is a hurricane. The following script first generates a random force value. Then, it prints a message regarding what type of wind that force represents, using
a switch statement. You are to rewrite this switch statement as one nested
if-else statement that accomplishes exactly the same thing. You may use else and/or elseif clauses. ranforce = randi([0, 12]); switch ranforce case 0 disp('There is no wind') case {1,2,3,4,5,6} disp('There is a breeze')
case {7,8,9} disp('This is a gale')
case {10,11}
disp('It is a storm')
case 12
disp('Hello, Hurricane!')
end 7th Edition•ISBN: 9780323087896Julie S Snyder, Linda Lilley, Shelly Collins388 solutions
7th Edition•ISBN: 9780323402118 (5 more)Gary A. Thibodeau, Kevin T. Patton1,505 solutions
11th Edition•ISBN: 9781111320102Ann Senisi Scott, Elizabeth Fong773 solutions
9th Edition•ISBN: 9780323319744 (1 more)Leighann Remmert, Sheila A Sorrentino1,611 solutions