BİLİŞİM - BİLGİSAYAR - EĞİTİM
  Soru12
 

Soru 12: Sigara anketi sonuç rapor programı

 

{Sigara anketi sonuç programı}

program sigara_anket;

uses crt;

label

  start;

var

 isim     :array [1..100] of string[20];

 cinsiyet :array [1..100] of string[5];

 yas      :array [1..100] of string[2];

 tercih   :array [1..100] of char;

 i, ii, ksayi  :integer;

begin

  clrscr;

  write('Ankete katılan kişi sayısını giriniz :');

  readln(ksayi);

  clrscr;

  for i:=1 to ksayi do

    begin

      writeln('Sıra No                :',i);

      write('Adı Soyadı             :');

      readln(isim[i]);

      write('Cinsiyeti              :');

      readln(cinsiyet[i]);

      write('Yaşı                   :');

      readln(yas[i]);

      write('Sigara Tercihi (0/1/2) :');

start:tercih[i]:=readkey;

      if tercih[i]='0' then

         writeln(' ',tercih[i],'- içmiyor  ');

      if tercih[i]='1' then

         writeln(' ',tercih[i],'- az içiyor');

      if tercih[i]='2' then

         writeln(' ',tercih[i],'- tiryaki  ');

      if (tercih[i]<>'0') and (tercih[i]<>'1') and

         (tercih[i]<>'2') then goto start;

      writeln('-------------------------------------');

    end;

  clrscr;

  for i:=1 to ksayi do

    begin

      gotoxy(1,1);  write('Sıra No');

      gotoxy(13,1); write('Adı Soyadı');

      gotoxy(35,1); write('Cinsiyeti');

      gotoxy(50,1); write('Yaşı');

      gotoxy(60,1); write('Sigara Tercihi');

      for ii:=1 to 70 do

        begin

          gotoxy(ii,2);

          write('-');

        end;

      gotoxy(3 ,i+2); write(i);

      gotoxy(13,i+2); write(isim[i]);

      gotoxy(37,i+2); write(cinsiyet[i]);

      gotoxy(51,i+2); write(yas[i]);

 

      if tercih[i]='0' then

        begin

          gotoxy(59,i+2);

          write(' ',tercih[i],'-İçmiyor');

        end;

      if tercih[i]='1' then

        begin

          gotoxy(59,i+2);

          write(' ',tercih[i],'-Az İçiyor');

        end;

      if tercih[i]='2' then

        begin

          gotoxy(59,i+2);

          write(' ',tercih[i],'-Tiryaki');

        end;

    end;

  readkey;

end.

 
 
  Bugün 181 ziyaretçi (278 klik) www.bilisim-egitim.tr.gg  
 
Bu web sitesi ücretsiz olarak Bedava-Sitem.com ile oluşturulmuştur. Siz de kendi web sitenizi kurmak ister misiniz?
Ücretsiz kaydol