CamposTylerCW31

CamposTylerCW31 - fprintf('Your grade: F\n'); end e...

Info iconThis preview shows page 1. Sign up to view the full content.

View Full Document Right Arrow Icon
NumG = 0; GradeSum = 0; response = 'Y'; while response=='Y'; w GradeValue = input('Input Grade: '); if (GradeValue <0); fprintf('Invalid Grade\n'); elseif (GradeValue >100); fprintf('Invalid Grade\n'); elseif (GradeValue >=90); NumG = NumG+1; GradeSum = GradeValue+GradeSum; fprintf('Your grade: A\n'); elseif (GradeValue >=80); NumG = NumG+1; GradeSum = GradeValue+GradeSum; fprintf('Your grade: B\n'); elseif (GradeValue >=70); NumG = NumG+1; GradeSum = GradeValue+GradeSum; fprintf('Your grade: C\n'); elseif (GradeValue >=60); NumG = NumG+1; GradeSum = GradeValue+GradeSum; fprintf('Your grade: D\n'); elseif (GradeValue <60); NumG = NumG+1; GradeSum = GradeValue+GradeSum;
Background image of page 1
This is the end of the preview. Sign up to access the rest of the document.

Unformatted text preview: fprintf('Your grade: F\n'); end e response = input('Do you wish to enter another grade? Y or N?\n', 's'); end FinalGrade = GradeSum/NumG; if (FinalGrade &gt;=95); fprintf('Final average grade is: %0.2f Excellent\n',FinalGrade); elseif (FinalGrade &gt;=80); fprintf('Final average grade is: %0.2f \n',FinalGrade); elseif (FinalGrade &gt;=70); fprintf('Final average grade is: %0.2f \n',FinalGrade); elseif (FinalGrade &gt;=60); fprintf('Final average grade is: %0.2f Probation \n',FinalGrade); elseif (FinalGrade &lt;60); fprintf('Final average grade is: %0.2f Failing \n',FinalGrade); end e...
View Full Document

This note was uploaded on 09/19/2011 for the course ENGE 1114 taught by Professor Twknott during the Fall '06 term at Virginia Tech.

Ask a homework question - tutors are online