gpa - letter ='A elseif(gpa>= 2.5&&(gpa<= 3.4...

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

View Full Document Right Arrow Icon
% 3/2/11  % Given a GPA between 0 and 4.0, write a script that uses a switch statement,   % to compute the equivalent letter grade:   % A (4.0  3.5), B (3.4  2.5), C (2.4  1.5), D (1.4 - .5), F (.4  0).  mygpa = input('What is the gpa?\n'); 
Background image of page 1
This is the end of the preview. Sign up to access the rest of the document.

Unformatted text preview: letter = 'A'; elseif (gpa >= 2.5) && (gpa <= 3.4) letter = 'B'; elseif (gpa >= 1.5) && (gpa <= 2.4) letter = 'C'; elseif (gpa >= .5) && (gpa <= 1.4) letter = 'D'; else letter = 'F'; end disp(letter)...
View Full Document

This note was uploaded on 05/01/2011 for the course HCSC 110 taught by Professor Amosjohnson during the Spring '11 term at Morehouse.

Ask a homework question - tutors are online