function PrintCurrentCountryData_Table_entries(fid, income_gr, year, country, TFR_2005, TFR_rep, TFR_MSRG, TFR_MAX_SR, TFR_PVC, TFR_GLD, SRG_int, SRG_rep, SRG_MSRG, SR_MSR, SR_GLD, SR_PVC) 
%    This function prints results in the two resulting Tables in the Science paper for each country 

% define printing formats
ftext = '%s \t ';   % for text variables like the country name
finti = '%5.0f';    % for integer variables like the year
fdeci = '%9.3f';    % for real valued variables like TFR

%-----Print data for the current country in Table 1
% define values to be printed (it is possible to add other variables); 
column_table_1 = [ year    TFR_2005    TFR_MSRG TFR_MAX_SR  TFR_PVC TFR_GLD];
format_var1 =     [finti;  fdeci;      fdeci;      fdeci;      fdeci;  fdeci;];

% print income level and country name
fprintf(fid(1), ftext, income_gr);
fprintf(fid(1), ftext, country);

% print the numerical values in the table
for column = 1:numel(column_table_1)
    fprintf(fid(1), [format_var1(column,:) ' \t'], column_table_1(column) );
end
fprintf(fid(1),'\n');


%-----Print data for the current country in the Table of Fiscal Support Ratios
% define values to be printed (it is possible to add other variables); 
column_table_SRG = [year    TFR_2005   TFR_rep   TFR_MSRG  SRG_int     SRG_rep SRG_MSRG];
format_varSRG =    [finti;  fdeci;      fdeci;   fdeci;       fdeci;      fdeci;  fdeci;];                        
                        
% print income level and country name
fprintf(fid(2), ftext, income_gr);
fprintf(fid(2), ftext, country);

% print the numerical values in the table
for column = 1:numel(column_table_SRG)
    fprintf(fid(2), [format_varSRG(column,:) ' \t'], column_table_SRG(column) );
end
fprintf(fid(2),'\n');

        
%-----Print data for the current country in Table 3
% define values to be printed (it is possible to add other variables); 
column_table_3 = [ year    TFR_2005    TFR_MAX_SR  TFR_PVC TFR_GLD SR_MSR  SR_PVC  SR_GLD];
format_var3 =     [finti;  fdeci;      fdeci;      fdeci;  fdeci;   fdeci;  fdeci;  fdeci;];

% print income level and country name
fprintf(fid(3), ftext, income_gr);
fprintf(fid(3), ftext, country);

% print the numerical values in the table
for column = 1:numel(column_table_3)
    fprintf(fid(3), [format_var3(column,:) ' \t'], column_table_3(column) );
end
fprintf(fid(3),'\n');
