% function to solve problems 5 and 6
% on practice quiz 5
% input should be a string of capital letters

function pracquiz5(input)
p=input-65;
L = length(p);

c(1)=p(1);
for k=2:L
c(k)=mod(p(k)+p(k-1),26);
end % for k
char(c+65)
%return
d(1)=p(1);
for k=2:L
d(k)=mod(p(k)-d(k-1),26);
end % for k
char(d+65)
return