Question
This is how the question is presented in MATLAB: Fill in theblank lines Switch case can be used with numerical range argument, e.g.x <100, when
This is how the question is presented in MATLAB: Fill in theblank lines
Switch case can be used with numerical range argument, e.g.x<100, when you start the function or script with
switch true
A script is being written with a function at the bottom. Fill inthe blanks.
SCRIPT:
quiz = input('Please enter a score between 0 to 50!');
grade=switchletgrade(quiz);
while quiz < 0 || quiz > 50
quiz = input('Your number is invalid! Please enter a scorebetween 0 to 50');
___________________
end
fprintf('The score that you entered received grade %s',grade)
FUNCTION:
function grade = switchletgrade(quiz)
switch true
case quiz>=45
grade = 'A';
case quiz<45&& quiz>=40
grade = 'B';
_________________
grade = 'C';
case quiz<35&& quiz>=30
grade = 'D';
_____________________
grade = 'F';
end
end
____________________________
___________________________________________________________________________
Step by Step Solution
3.37 Rating (147 Votes )
There are 3 Steps involved in it
Step: 1
The Complete Matlab code for the problem quiz inputPlease enter a scor...Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started