elseif to switch statement
显示 更早的评论
I am attempting to switch this into a switch statement.
TestScore = input('Enter a score from the keyboard ')
if(TestScore > 89)
disp('Your Letter grade is A')
elseif(TestScore > 79)
disp('Your Letter grade is B')
elseif(TestScore > 69)
disp('Your Letter grade is C')
elseif(TestScore > 59)
disp('Your Letter grade is D')
else
disp('Your Letter grade is F')
end
采纳的回答
更多回答(0 个)
类别
在 帮助中心 和 File Exchange 中查找有关 GNC and Avionics 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!