This program calculte te missing side at a triangle

Delphi & Pascal (česká wiki)
Přejít na: navigace, hledání
Kategórie: KMP (Programy mladých programátorů)

Program: Pytagoras.pas

This program calculte te missing side at a triangle.
{ PYTAGORAS.PAS                                                     }
{ This program calculte te missing side at a triangle.              }
{                                                                   }
{ Author: Unknown                                                   }
{ Datum: 26.06.2009                            http://www.trsek.com }
 
program pytagoras;
USES crt;
procedure driehoek;
begin
        writeln('       *  ');
        writeln('      /|  ');
        writeln('   z / |  ');
        writeln('    /  | x');
        writeln('   /   |  ');
        writeln('  *----*  ');
        writeln('    y     ');
end;
var temp:integer;
procedure start;
begin
        clrscr;
        gotoxy(1,2);
        driehoek;
        temp := 1;
        While temp < 10 Do
        Begin
                gotoxy(15,temp);
                writeln('|');
                temp := temp+1;
        End;
        writeln('--------------*--------------------');
end;
procedure standaart;
begin
        start;
        gotoxy(17,1);
        writeln('Waarde van X:');
        gotoxy(17,4);
        writeln('Waarde van Y:');
 
end;
var x,y,xa,ya:integer;
var z:real;
begin
        {-----------------}
        { Invoer gedeelte }
        {_________________}
        start;
        gotoxy(17,1);
        writeln('Waarde van X:');
        gotoxy(17,2);
        readln(x);
        gotoxy(17,4);
        writeln('Waarde van Y:');
        gotoxy(17,5);
        readln(y);
 
 
        {------------------}
        { Bereken gedeelte }
        {__________________}
        xa := SQR(x);
        ya := SQR(y);
        z  := xa + ya;
        z  := SQRT(z);
        gotoxy(15,12);
        writeln('Berekenen.');
        gotoxy(9,13);
        write('{--------------------}');
        gotoxy(10,13);
        temp := 0;
        While temp < 20 Do
        Begin
                delay(50);
                write('+');
                temp := temp+1;
        End;
 
 
 
 
        {-----------------------}
        { Resultaten laten zien }
        {_______________________}
        gotoxy(17,7);
        writeln('Waarde van z:');
        gotoxy(17,8);
        writeln(z);
        gotoxy(15,12);
        writeln('Berekent.   ');
        gotoxy(1,20);
        writeln('Druk op een toets om af te sluiten.');
 
 
        readkey;
end.