Write a program using Matlab that asks the user for their last three grades and final grade and gives them their overall final grade. The three Midterms are worth 70% and Final is worth 30%. The program will display their Final grade with a grade letter corresponding to it. Run your program and verify that it operates correctly (hint: you might need to use “If, else statements”)
Matlab Code:
m1=input("Enter Midterm1 Marks");
m2=input("Enter midterm2 marks");
m3=input("Enter midterm3 marks");
f1=input("Enter final marks");
mid=((m1+m2+m3)/300)*70
final=((f1/100)*30)
n=mid+final
if n >= 91
grade='A';
elseif n >= 81
grade='B';
elseif n >= 71
grade='C';
elseif n >= 61
grade='D';
else
grade='F';
end
disp(grade);
Output Screenshot:
Thank you have a great day.........please do like:)-
Get Answers For Free
Most questions answered within 1 hours.