clear all;
%ex. 3, 4
close all;

fid=fopen("file_03_10a.txt","r");
Y=[];
s=fgets(fid);
while(s!=(-1))
Y=[Y,str2num(s)];
s=fgets(fid);
end
fclose(fid);

fid=fopen("file_03_10b.txt","r");
W=[];
s=fgets(fid);
while(s!=(-1))
W=[W,str2num(s)];
s=fgets(fid);
end
fclose(fid);

X=[];Z=[];U=[];
n=length(Y);
for i=1:n/2
  X(i)=Y(2*i-1);
  U(i)=W(2*i-1);
  Z(i)=Y(2*i);
end
figure();


%gscatter(X,Z,G,'rg','.+',[16,16]);
scatter (X,Z, 225, 'b','.');
xlabel("the first test scores");
ylabel("the final exam scores",'rotation',90);
title ("Final exam versus the first test");

figure();

scatter (U,Z, 225, 'r','.');
xlabel("the second test scores");
ylabel("the final exam scores",'rotation',90);
title ("Final exam versus the second test");

