Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- program l1q5;
- uses crt;
- var id,i:integer;
- op:char;
- otimo,bom,regular,ruim,pessimo:integer;
- participantes:integer;
- media:real;
- begin
- id:=100;
- while id>1 do
- begin
- write('digite a sua idade: ');
- read(id);
- writeln('o que voce achou do filme?');
- writeln('A - otimo');
- writeln('B - bom');
- writeln('C - regular');
- writeln('D - ruim');
- writeln('E - pessimo');
- read(op);
- case op of
- 'A':begin
- otimo:=otimo+1;
- end;
- 'B':begin
- bom:=bom+1;
- end;
- 'C':begin
- regular:=regular+1;
- end;
- 'D':begin
- ruim:=ruim+1;
- end;
- 'E':begin
- pessimo:=pessimo+1;
- end;
- end;
- i:=i+1;
- end;
- media:=i/id;
- participantes:=i;
- write('media de idade dos participantes: ',i/id);
- writeln('total de participantes: ',i);
- readkey;
- end.
Add Comment
Please, Sign In to add comment