Created

Embed URL

HTTPS clone URL

SSH clone URL

You can clone with HTTPS or SSH.

Download Gist
View Omar_Prieto_Problem1.m
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25
% Problem 2
 
prompt = 'Would you like to check your grade? (Enter yes or no)';
 
str = input(prompt, 's')';
if isempty(str);
str = 'yes';
end;
 
prompt = 'please enter your score';
result = input(prompt);
s = result;
if s >= 89.5 && s <= 100;
disp('Your overall scrore is an A');
elseif s >= 79.5 && s <= 89.5;
disp('Your overall scrore is a B');
elseif s >= 69.5 && s <= 79.5;
disp('Your overall scrore is a C');
elseif s >= 59.5 && s <= 69.5;
disp('Your overall scrore is a D');
elseif s >= 0 && s <= 59.5;
disp('Your overall scrore is an F');
else s > 100 && s < 0;
disp('Invalid grade entered');
end;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Something went wrong with that request. Please try again.