function CheckItOut()

clc
disp('Over the year errors (in minutes) ...')
disp(' ')
disp('     SunRise            SunSet          Day Length ')
disp('  MaxErr   AveErr   MaxErr   AveErr   MaxErr   AveErr') 
disp('-------------------------------------------------------------------')
[East,Central,Mountain,Pacific] = GetTheData();

for k=1:length(East)
   City = East(k);
   [a,b,c,d,e,f] = MaxErr(City,'EST');
   disp([ sprintf('  %5.1f    %5.1f    %5.1f    %5.1f     %5.1f   %5.1f',a,b,c,d,e,f) '      '  City.Name ]);
end
for k=1:length(Central)
   City = Central(k);
   [a,b,c,d,e,f] = MaxErr(City,'CST');
   disp([ sprintf('  %5.1f    %5.1f    %5.1f    %5.1f     %5.1f   %5.1f',a,b,c,d,e,f) '      '  City.Name ]);
end
for k=1:length(Mountain)
   City = Mountain(k);
   [a,b,c,d,e,f] = MaxErr(City,'MST');
   disp([ sprintf('  %5.1f    %5.1f    %5.1f    %5.1f     %5.1f   %5.1f',a,b,c,d,e,f) '      '  City.Name ]);
end
for k=1:length(Pacific)
   City = Pacific(k);
   [a,b,c,d,e,f] = MaxErr(City,'PST');
   disp([ sprintf('  %5.1f    %5.1f    %5.1f    %5.1f     %5.1f   %5.1f',a,b,c,d,e,f) '      '  City.Name ]);
end
    
    
    function [RiseErrMax,RiseErrAve,SetErrMax,SetErrAve,LengthErrMax,LengthErrAve] = MaxErr(City,Zone)
    R = zeros(365,1); S = zeros(365,1);
    for t=1:365
        [R(t),S(t)] = SunRiseAndSet(City.Lat,City.Long,t,Zone);
    end
    RiseErr = abs(R-City.Rise);
    RiseErrMax = 60*max(RiseErr);
    RiseErrAve = 60*sum(RiseErr)/365;
    SetErr  = abs(S-City.Set);
    SetErrMax = 60*max(SetErr);
    SetErrAve = 60*sum(SetErr)/365;
    LengthErr = abs((S-R)-(City.Set-City.Rise));
    LengthErrMax = 60*max(LengthErr);
    LengthErrAve = 60*sum(LengthErr)/365;
    
    
    
        