%-------------------------------------% % Homework 3: problem 3.2 % % Date: 9/30/02 % % % % Gun Srijuntongsiri % % gs61 % % ?????? % %-------------------------------------% % The code in the book is incorrect. The last two cases (temp > 99.5 % and temp > 103.0) will never be executed. Any temp > 97.5 will % trigger the disp('Temperature normal'), regardless of whether % temp is in fact > 99.5 or > 103.0. So a temperature of 3000 will % still be considered "normal". % Below is the correct version % For testing purpose, $temp$ contains the testing temperature. temp = input('Enter Temp: '); % Determine the patient's condition depending on his temperature. if temp > 103.0 disp('Temperature dangerously high'); elseif temp > 99.5 disp('Temperature slightly high'); elseif temp > 97.5 disp('Temperature normal'); else disp('Temperature below normal'); end