Script Program Matematika



Program PasMath;
Uses Crt;
Const Phi = 3.14;
Var
  pjg,lbr,jari,alas,tinggi : real;
  luas,kel : real;
  pilih : integer;
Begin
   pilih := 1;
   While pilih <> 0 Do
   Begin
      ClrScr;
      Gotoxy(13,3); Write('PROGRAM MATEMATIKA DENGAN PASCAL');
      Gotoxy(13,4); Write('================================');
      Gotoxy(13,6); Write('1. MENGHITUNG LUAS DAN KELILING SEGIEMPAT');
      Gotoxy(13,7); Write('2. MENGHITUNG LUAS DAN KELILING LINGKARAN');
      Gotoxy(13,8); Write('3. MENGHITUNG LUAS SEGITIGA');
      Gotoxy(13,9); Write('0. KELUAR DARI PROGRAM');
      Gotoxy(13,11); Write('Pilihan Anda?');
      Read(pilih);
      Case pilih of
       1: Begin
             ClrScr; pjg := 0; lbr := 0;
             Gotoxy(13,3); Write('MENGHITUNG LUAS DAN KELILING SEGIEMPAT');
             Gotoxy(13,4); Write('======================================');
             Gotoxy(13,6); Write('1. Masukkan panjang segiempat = '); Readln(pjg);
             Gotoxy(13,7); Write('2. Masukkan lebar segiempat   = '); Readln(lbr);
             luas := pjg * lbr;
             kel := 2 * (pjg + lbr);
             Gotoxy(13,9);  Write('Luas segiempat adalah         = ', luas:9:2);
             Gotoxy(13,10); Write('Keliling segiempat adalah     = ', kel:9:2);

             Readkey;
          End;
       2: Begin
             ClrScr; jari := 0;
             Gotoxy(13,3); Write('MENGHITUNG LUAS DAN KELILING LINGKARAN');
             Gotoxy(13,4); Write('======================================');
             Gotoxy(13,6); Write('Jari-jari lingkaran        = '); Readln(jari);
             luas := Phi * jari *jari;
             kel := 2 * Phi * jari;
             Gotoxy(13,8); Write ('Luas lingkaran adalah     = ', luas:9:2);
             Gotoxy(13,9); Write('Keliling lingkaran adalah  = ', kel:9:2);
             Readkey;
          End;
       3: Begin
             ClrScr; alas := 0; tinggi := 0;
             Gotoxy(13,3); Write('MENGHITUNG LUAS SEGITIGA');
             Gotoxy(13,4); Write('========================');
             Gotoxy(13,6); Write('Alas segitiga    = '); Readln(alas);
             Gotoxy(13,7); Write('Tinggi segitiga  = '); Readln(tinggi);
             luas := 0.5 * alas * tinggi;
             Gotoxy(13,9); Write('Luas segitiga    = ', luas:9:2);
             Readkey;
          End;
      End;
   End;
End.
Continue >>>
 

To Be Smart Everything ♣ ♣ ♣ Mamanunes Templates ♣ ♣ ♣ Inspiração: Templates Ipietoon
Ilustração: Gatinhos - tubes by Jazzel (Site desativado)