function y = career(n,k)
%This function file computes the batting average for each year
%in a k-year career, asuming n at bats in each year.  Then it 
%lists the average for each of the years in the career, and 
%finally computes a lifetime average.
Y=zeros(1,k);
for j=1:k
    	Y(j)=yearbattingaverage(n);
end
disp(strcat('Best avg: ', num2str(max(Y), 4)))
disp(strcat('Worst average: ', num2str(min(Y), 4)))
disp(strcat('Lifetime avg: ', num2str(sum(Y)/k, 4)))
