Program ChipDAT (input,output); (*Prg reads (red)gset chip data array & makes nw outfile *) var ans,k,b,c,scnum,ctr,ct :integer; ifil,ofil :text; namei,class :string; d,e,f,g,h,i,j,sum,frac,a :real; answ :char; Begin writeln('Enter the filename'); (*name of file with gene expression data*) readln(namei); assign(ifil,namei); reset(ifil); assign(ofil,'binout.nna'); rewrite(ofil); k:=0; b:=0; Writeln('How many patients are there?'); readln(ans); for c:=1 to ans do BEGIN for ct:=1 to 146 do (*146=gene number used in this training*) begin for ctr:=1 to b do read(ifil,a); readln(ifil,a); readln(ifil); (*to jump over spacer line in input file*) k:=succ(k); if k mod 11 =0 then begin writeln(ofil); write(ofil,'&'); end; if (a<0) then begin write(ofil,' 1'); a:=-a; end else write(ofil,' 0'); if (a>=0) and (a<0.5) then write(ofil,' 0 0') else if (a>=0.5) and (a<1.0) then write(ofil,' 0 1') else if (a>=1.0) and (a<2.0) then write(ofil,' 1 0') else write(ofil,' 1 1'); end;(*WHILE*) writeln(ofil); write(ofil,'& '); b:=succ(b); writeln('Is patient #',b,' diseased? YorN'); readln(answ); answ:=upcase(answ); if answ='Y'then writeln(OFIL,'1.0') else writeln(ofil,'0.0'); reset(ifil); k:=0; END;(*FOR 1 to ans*) close(ifil); close(ofil); end.