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

1 Expert Approved Answer
Step: 1 Unlock

The Complete Matlab code for the problem quiz inputPlease enter a scor... View full answer

blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Programming Questions!