Ask Question

Name:
Title:
Your Question:

Answer Question

Name:
Your Answer:
User Submitted Source Code!


Description:
  pascal
Language: PASCAL
Code:
program univer;
uses crt,graph;
var scheda,risol,cont,a,b,c,d,voto,somma,media,v18,v24,v30:integer;
begin
scheda:=detect;
initgraph(scheda,risol,'i:bgi');
a:=10;
b:=10;
c:=630;
d:=470;
setcolor(10);
cont:=0;
repeat
 rectangle(a,b,c,d);
 a:=a+2;
 b:=b+2;
 c:=c-2;
 d:=d-2;
 cont:=cont+1;
 delay(500);
until cont=95;
setcolor(14);
settextstyle(3,horizdir,4);
outtextxy(220,200,'Buzzi Simone');
outtextxy(202,230,'Corradi Stefano');
delay(20000);delay(20000);delay(20000);
setcolor(10);
repeat
 rectangle(a,b,c,d);
 a:=a-2;
 b:=b-2;
 c:=c+2;
 d:=d+2;
 cont:=cont-1;
 delay(500);
 cleardevice;
until cont=0;
writeln;
writeln;
textcolor(10);
setcolor(10);
cont:=0;
settextstyle(3,horizdir,3);
repeat
cont:=0;
cleardevice;
repeat
 outtextxy(0,0,'                        UNIVERSITA');
 outtextxy(0,18,'Inserite il voto dello studente 0 per visualizzare la media');
 gotoxy(1,6);
 read(voto);
 if (voto<31) and (voto>17) then
                             begin
                             cont:=cont+1;
                             somma:=somma+voto;
                             case voto of
                                 18:v18:=v18+1;
                                   24:v24:=v24+1;
                                   30:v30:=v30+1;
                             end;
                             end;
 cleardevice;
 until (voto=0) and (cont>1);
 closegraph;
 media:=somma div cont;
 writeln('         la media dei voti dei ',cont,' studenti Š ---> ',media);
 delay(20000);delay(20000);delay(20000);delay(20000);

 initgraph(scheda,risol,'i:bgi');
 setcolor(10);
 a:=450;
 b:=450;
 c:=450;
 line(10,150,10,470);
 line(10,470,320,470);
 a:=a-(v18*20);
 setcolor(red);
 rectangle(20,450,40,a);
 b:=b-(v24*20);
 setcolor(blue);
 rectangle(60,450,80,b);
 c:=c-(v30*20);
 setcolor(yellow);
 rectangle(100,450,120,c);
 settextstyle(3,horizdir,2);
 outtextxy(20,448,'18');
 outtextxy(60,448,'24');
 outtextxy(100,448,'30');
 line(0,250,5,250);
 outtextxy(10,10,'  premi <esc> per uscire un altro tasto per continuare');
until readkey=#27;
closegraph;

end.
          
Comments: