%externalroutine printres(%string (255) s) %externalroutinespec define(%string (255) s) %integer i,j,k,q,p,hit %ownintegerarray num(1:5) = 12, 34, 6, 16, 7 %integerarray cind(1:6) %ownbyteintegerarray char(1:5) = 'P', 'N', 'A', 'E', 'O' %integerarray ind(1:75) %string (5) %array name(1:75) %ownintegerarray res(1:75) = 87, 62, 75, 54, 53, 73, 57, 31, 55, 46, 44, 63, 74, 38, 40, 71, 55, 50, 26, 55, 42, 33, 38, 78, 26, 78, 54, 47, 72, 67, 69, 62, 47, 23, 79, 15, 63, 44, 24, 23, 22, 23, 45, 47, 45, 27, 42, 44, 29, 40, 32, 24, 55, 53, 34, 48, 57, 34, 39, 37, 29, 29, 65, 53, 56, 44, 75, 54, 30, 59, 26, 29, 51, 25, 18 %routine print res %integer i,j,k,q k = 1; q = 1 %cycle i = 1, 1, 75 %if i = cind(k+1) %then k = k+1 q = ind(i) printstring(name(q)) q = res(ind(i)) write(q, 3) printstring(" !") p = q//2 %if p > 0 %start %cycle j = 1, 1, p printsymbol('*') %repeat %finish newline %repeat %end define("1,".s) selectoutput(1) ind(i) = i %for i = 1,1,75 k = 1; q = 1 %cycle i = 1,1,6 cind(i) = k %exit %if i = 6 k = k+num(i) %cycle j = 1, 1, num(i) name(q) = tostring(char(i)) %if j < 10 %start name(q) = name(q).tostring(j+'0')." " %else name(q) = name(q).tostring((j//10)+'0').tostring(j-(j//10)*10+'0') %finish q = q+1 %repeat %repeat print res hit = 0 %cycle i = 1,1,75 hit = 0 %cycle j = 1,1,75-i %if res(ind(j)) < res(ind(j+1)) %start hit = 1 q = ind(j); ind(j) = ind(j+1); ind(j+1) = q %finish %repeat %exit %if hit = 0 %repeat newpage printstring("Questionaire Results in numerical order. (one '*' is two 'votes') ") print res %end %endoffile