SHARE
TWEET

Untitled

a guest Jan 28th, 2015 175 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. program pola_i_objetosci;
  2.  
  3. uses
  4.   crt;
  5.  
  6. const
  7.   PI = 3.14;
  8.  
  9. var
  10.   C : Char;
  11.   r, h, a, Pole : Real;
  12.  
  13. procedure Kolo;
  14. begin
  15.   ClrScr;
  16.   Write('Podaj dlugosc promienia: ');
  17.   Readln(r);
  18.   Pole := PI * r * r;
  19.   Writeln('Pole = ', Pole : 0 : 2);
  20. end;
  21.  
  22. procedure Trojkat;
  23. begin
  24.   ClrScr;
  25.   Write('Podaj wysokosc trojkata: ');
  26.   Readln(h);
  27.   Write('Podaj dlugosc podstawy: ');
  28.   Readln(a);
  29.   Pole := 0.5 * h * a;
  30.   Writeln('Pole = ', Pole : 0 : 2);
  31. end;
  32.  
  33. procedure Kwadrat;
  34. begin
  35.   ClrScr;
  36.   Write('Podaj dlugosc boku: ');
  37.   Readln(a);
  38.   Pole := a * a;
  39.   Writeln('Pole = ', Pole : 0 : 2);
  40. end;
  41.  
  42. begin
  43.   repeat
  44.     ClrScr;
  45.     Writeln('Pole jakiej figury chcesz policzyc?');
  46.     Writeln('1. Kolo');
  47.     Writeln('2. Trojkat');
  48.     Writeln('3. Kwadrat');
  49.     Writeln;
  50.     Writeln('4. Wyjscie');
  51.     Writeln;
  52.     Writeln('Aby dokonac wyboru nacisnij cyfre od 1 do 4.');
  53.     C := ReadKey;
  54.   until C in ['1'..'4'];
  55.   case C of
  56.     '1' : Kolo;
  57.     '2' : Trojkat;
  58.     '3' : Kwadrat;
  59.     '4' : Exit;
  60.   end;
  61.   Writeln('Nacisnij dowolny klawisz.');
  62.   repeat
  63.   until KeyPressed;
  64. end.
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
Not a member of Pastebin yet?
Sign Up, it unlocks many cool features!
 
Top