I\'m writing a MATLAB script that reads grades from an Excel file, computes and
ID: 3676036 • Letter: I
Question
I'm writing a MATLAB script that reads grades from an Excel file, computes and displays a Final Average, and then asks if the user is satisfied with their grade and displays a string response depending on the user's answer. For some reason the If Else statement I wrote isn't working and I can't find it in my textbook. This is what I have written for the display section of the script
Name = input('Hello, Student! Please Type Your Name: ','s');
fprintf('Well %s, A Numerical Representation of Your Current Standing in the Class is %0.0f out of 100. ',Name,Final_Grade_Avg);
Happiness_Factor = menu('That cool with you?','Yes','No');
if (Happiness_Factor == '1')
disp('Well done, then!')
else fprintf('Sucks to be you!')
end
Explanation / Answer
Name = input('Hello, Student! Please Type Your Name: ','s');
fprintf('Well %s, A Numerical Representation of Your Current Standing in the Class is %0.0f out of 100. ',Name,Final_Grade_Avg);
Happiness_Factor = menu('That cool with you?','Yes','No');
if (Happiness_Factor == 1)
disp('Well done, then!')
else fprintf('Sucks to be you!')
end