Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Note: the subject is MATLAB Need to use ( SWITCH statement instead of IF statement ) to get the same result as it is %%

Note: the subject is MATLAB

Need to use ( SWITCH statement instead of IF statement ) to get the same result as it is

%%

clc clear close all

for k = 1:5 X = input('Enter a score for between 0 and 100 : '); if (X >= 90) Lettergrade = 'A' elseif (X >= 80) Lettergrade = 'B' elseif(X >=70) Lettergrade = 'C' elseif(X >=60) Lettergrade = 'D' elseif(X<60) Lettergrade = 'F' end end

_________________________

that what i got so far BUT its give an error

for k = 1:5 X = input('Enter a score for between 0 and 100 : '); Switch X case 'X >= 90' disp('Letter Grade = A')

case 'X >= 80' disp('Letter Grade = B')

case 'X >= 70' disp('Letter Grade = C')

case 'X >= 60' disp('Letter Grade = D')

case 'X < 60' disp('Letter Grade = F') end end

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Essential SQLAlchemy Mapping Python To Databases

Authors: Myers, Jason Myers

2nd Edition

1491916567, 9781491916568

More Books

Students also viewed these Databases questions

Question

What are the Five Phases of SDLC? Explain each briefly.

Answered: 1 week ago

Question

How can Change Control Procedures manage Project Creep?

Answered: 1 week ago