%-------------------------------------------------------------------------------
% lecture8c
%-------------------------------------------------------------------------------
  clear
% more on
  more off
  clc
  echo on
% echo off
%-------------------------------------------------------------------------------
% conditional update

% set up input
i=1
g = input('enter grade: ')
max = g % max value "so far"

% find max from input grades
while g > -eps
 grades(i) = g
 i = i+1 
 g = input('enter grade: ')
   if g > max
      max = g
   end
end
if i > 0
 max
 grades
else
 disp(['no grades entered!'])
end

