Academic Integrity: tutoring, explanations, and feedback — we don’t complete graded work or submit on a student’s behalf.

This the orginal question, but as you answer can you provide a reason as to why

ID: 3923889 • Letter: T

Question

This the orginal question, but as you answer can you provide a reason as to why you out that input in your code. Also I know that the code is suppose to start with

grade=input('Please enter your grade');

I'm stuck that when i enter any vaule higher than 66 it always results with a letter grade D

the following MATLAB code is intended to assign a letter grade based on a numerical grade (the numerical grades are percentages). Will this code work properly? If not, explain why and rewrite the code so that it works as intended. (Assume that the variable grade is assigned a value before this code is run.)

end

Explanation / Answer

try this matlab code. you will get right result.

main.m

clc;
close all;
clear all;
grade=input('Please enter your marks : ');
if grade < 66.0
     disp('The grade is F.')
elseif grade >= 66.0 && grade <76.0
     disp('The grade is D.')
elseif grade >= 76.0 && grade <86.0
     disp('The grade is C.')
elseif grade >= 86.0&& grade <95.0
     disp('The grade is B.')
elseif grade >= 95.0
     disp('The grade is A.')
end

Output:

Please enter your marks : 96
The grade is A.

Hire Me For All Your Tutoring Needs
Integrity-first tutoring: clear explanations, guidance, and feedback.
Drop an Email at
drjack9650@gmail.com
Chat Now And Get Quote