Showing posts with label pascal. Show all posts
Showing posts with label pascal. Show all posts

Script Program Penghitungan Volume Benda


Bismillahirrahmanirrahim.
Program Penghitungan Volume Benda  dibuat menggunakan bahasa pemrograman pascal. Program ini bisa digunakan untuk menghitung volume sebuah benda dengan berbagai bentuk. Contohnya Akuarium, Bak Mandi, Tabung dll.

Program VolumeMath;
Uses Crt;
Const Phi = 3.14;
Var
panjang,lebar,tinggi,alas,jari : real;
Volume,rusuk : real;
pilih,I :integer;
Begin
Pilih := 1;
While pilih <> 0 Do
Begin
ClrScr;
Gotoxy(13,3); write ('MENGHITUNG VOLUME DENGAN PASCAL');
Gotoxy(13,4); write ('===============================');
Gotoxy(13,6); write ('1. Menghitung Volume Balok');
Gotoxy(13,7); write ('2. Menghitung Volume Kubus');
Gotoxy(13,8); write ('3. Menghitung Volume Prisma');
Gotoxy(13,9); write ('4. Menghitung Volume Tabung');
Gotoxy(13,10); write ('5. Menghitung Volume Limas');
Gotoxy(13,11); write ('6. Menghitung Volume Kerucut');
Gotoxy(13,12); write ('7. Menghitung Volume Bola');
Gotoxy(13,13); write ('0. Keluar dari Program');
Gotoxy(13,15); write ('Pilihan Anda?');
Read (pilih);
Case pilih of
1: Begin
clrscr; panjang := 0; lebar := 0; tinggi:= 0;
Gotoxy(13,3); Write('MENCARI VOLUME BALOK');
Gotoxy(13,4); Write('====================');
Gotoxy(13,6); Write('Panjang Balok = ');Readln(panjang);
Gotoxy(13,7); Write('Lebar Balok = ');Readln(lebar);
Gotoxy(13,8); Write('Tinggi Balok = ');Readln(tinggi);
Volume := panjang * lebar * tinggi;
Gotoxy(13,10); Write('Volume Balok = ', Volume:9:2);
Readkey;
End;
2: Begin
clrscr; rusuk := 0; rusuk := 0; rusuk :=0;
Gotoxy(13,3); Write('MENCARI VOLUME KUBUS');
Gotoxy(13,4); Write('====================');
Gotoxy(13,6); Write('Rusuk Kubus = ');Readln(rusuk);
Volume := rusuk * rusuk * rusuk;
Gotoxy(13,8); Write('Volume Kubus = ', Volume:9:2);
Readkey;
End;
3: Begin
clrscr; alas := 0; tinggi := 0;
Gotoxy(13,3); write('MENCARI VOLUME PRISMA');
Gotoxy(13,4); write('=====================');
Gotoxy(13,6); write('Alas Prisma = ');readln(alas);
Gotoxy(13,7); write('Tinggi Prisma = ');readln(tinggi);
Volume := alas * tinggi;
Gotoxy(13,9); write('Volume Prisma = ',Volume:9:2);
Readkey;
End;
4: Begin
clrscr; jari := 0; tinggi := 0;
Gotoxy(13,3); write('MENCARI VOLUME TABUNG');
Gotoxy(13,4); write('=====================');
Gotoxy(13,6); write('Jari-jari Tabung = ');readln(jari);
Gotoxy(13,7); write('Tinggi Tabung = ');readln(tinggi);
Volume := 2 * Phi * jari * jari + 2 * Phi * jari * tinggi;
Gotoxy(13,9); write('Volume Tabung = ',Volume:9:2);
Readkey;
End;
5: Begin
clrscr; alas := 0; tinggi := 0;
Gotoxy(13,3); write('MENCARI VOLUME LIMAS');
Gotoxy(13,4); write('====================');
Gotoxy(13,6); write('Alas Limas = ');readln(alas);
Gotoxy(13,7); write('Tinggi Limas = ');readln(tinggi);
Volume := 1/3 * alas * tinggi;
Gotoxy(13,9); write('Volume Limas = ',Volume:9:2);
Readkey;
End;
6: Begin
clrscr; alas := 0; tinggi := 0;
Gotoxy(13,3); write('MENCARI VOLUME KERUCUT');
Gotoxy(13,4); write('======================');
Gotoxy(13,6); write('Jari Kerucut = ');readln(jari);
Gotoxy(13,7); write('Tinggi Kerucut = ');readln(tinggi);
Volume := 1/3 * Phi * jari * jari * tinggi;
Gotoxy(13,9); write('Volume Kerucut = ',Volume:9:2);
Readkey;
End;
7: Begin
clrscr; alas := 0; tinggi := 0;
Gotoxy(13,3); write('MENCARI VOLUME BOLA');
Gotoxy(13,4); write('======================');
Gotoxy(13,6); write('Jari Bola = ');readln(jari);
Gotoxy(13,7); write('Panjang Bola = ');readln(panjang);
Volume := 4/3 * Phi * jari * jari;
Gotoxy(13,9); write('Volume Bola = ',Volume:9:2);
Readkey;
End;
End;
End;
End.

Untuk melihat penjelasan yang lebih detail mengenai script di atas, anda bisa download makalahnya. Terima Kasih, Semoga Bermanfaat
Fastabiqul Khairaats.
Continue >>>

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 >>>

Script Program Penghitung Luas dan Keliling Segi empat


Program PasMath;
Uses Crt;
Const Phi = 3.14;
Var
  pjg,lbr,jari,alas,tinggi : real;
  luas,kel : real;
  pilih : integer;
Begin

             ClrScr; pjg := 0; lbr := 0;
             Gotoxy(13,3); Write('MENGHITUNG LUAS DAN KELILING SEGIEMPAT');
             Gotoxy(13,4); Write('======================================');
             Gotoxy(13,6); Write('Masukkan panjang segiempat = '); Readln(pjg);
             Gotoxy(13,7); Write('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.
Continue >>>

Script Tampilan Penjumlahan


Program yang satu ini adalah sebuah program yang dapat menampilkan penjumlahan 1 sampai dengan 10, namun bukan itu tujuan pertama dalam postingan ini. Tujuannya adalah untuk mempelajari, memahami dan mempraktekkan logika programming yang terdapat di dalam scriptnya .

Program Tambah_W;
Uses Crt;
Var
  I,H,J,K,L,M,N,O,P,Q    : integer;
Begin
    ClrScr;
    I := 1;
    While I < 11 Do
        Begin
           If I < 20 Then
              Begin
                 Gotoxy(4,I); Write(I,' + 1 =  ',I + 1);
              End
           Else
              Begin
                 Gotoxy(4,I); Write(I,' + 1 = ',I + 1);
              End;
           I := I + 1;
        End;

    I := 1;
    While I < 11 Do
       Begin
          H := I + 2;
          If I < 10 Then
          Begin
             If H < 20 Then
                Begin
                   Gotoxy(18,I); Write(I,' + 2 =  ',I + 2);
                End
             Else
                Begin
                   Gotoxy(18,I); Write(I,' + 2 =',I + 2);
                End;
             End
          Else
             Begin
                Gotoxy(17,I); Write(I,' + 2 =  ',I + 2);
             End;
           I := I + 1;
          End;

    I := 1;
    While I < 11 Do
       Begin
          H := I + 3;
          If I < 10 Then
          Begin
             If H < 20 Then
                Begin
                   Gotoxy(32,I); Write(I,' + 3 =  ',I + 3);
                End
             Else
                Begin
                   Gotoxy(32,I); Write(I,' + 3 =',I + 3);
                End;
             End
          Else
             Begin
                Gotoxy(31,I); Write(I,' + 3 =  ',I + 3);
             End;
           I := I + 1;
          End;

    I := 1;
    While I < 11 Do
       Begin
          H := I + 4;
          If I < 10 Then
          Begin
             If H < 20 Then
                Begin
                   Gotoxy(46,I); Write(I,' + 4 =  ',I + 4);
                End
             Else
                Begin
                   Gotoxy(46,I); Write(I,' + 4 =',I + 4);
                End;
             End
          Else
             Begin
                Gotoxy(45,I); Write(I,' + 4 =  ',I + 4);
             End;
           I := I + 1;
          End;

    I := 1;
    While I < 11 Do
       Begin
          H := I + 5;
          If I < 10 Then
          Begin
             If H < 20 Then
                Begin
                   Gotoxy(60,I); Write(I,' + 5 =  ',I + 5);
                End
             Else
                Begin
                   Gotoxy(60,I); Write(I,' + 5 =',I + 5);
                End;
             End
          Else
             Begin
                Gotoxy(59,I); Write(I,' + 5 =  ',I + 5);
             End;
           I := I + 1;
          End;

    I := 1;
    While I < 11 Do
       Begin
          H := I + 6;
          If I < 10 Then
          Begin
             If H < 20 Then
                Begin
                   Gotoxy(4,I + 12); Write(I,' + 6 =  ',I + 6);
                End
             Else
                Begin
                   Gotoxy(4,I + 12); Write(I,' + 6 =',I + 6);
                End;
             End
          Else
             Begin
                Gotoxy(3,I + 12); Write(I,' + 6 =  ',I + 6);
             End;
           I := I + 1;
          End;
              I := 1;
    While I < 11 Do
       Begin
          H := I + 7;
          If I < 10 Then
          Begin
             If H < 20 Then
                Begin
                   Gotoxy(18,I + 12); Write(I,' + 7 =  ',I + 7);
                End
             Else
                Begin
                   Gotoxy(18,I + 12); Write(I,' + 7 =',I + 7);
                End;
             End
          Else
             Begin
                Gotoxy(17,I + 12); Write(I,' + 7 =  ',I + 7);
             End;
           I := I + 1;
          End;

    I := 1;
    While I < 11 Do
       Begin
          H := I + 8;
          If I < 10 Then
          Begin
             If H < 20 Then
                Begin
                   Gotoxy(32,I + 12); Write(I,' + 8 =  ',I + 8);
                End
             Else
                Begin
                   Gotoxy(32,I + 12); Write(I,' + 8 =',I + 8);
                End;
             End
          Else
             Begin
                Gotoxy(31,I + 12); Write(I,' + 8 =  ',I + 8);
             End;
           I := I + 1;
          End;

    I := 1;
    While I < 11 Do
       Begin
          H := I + 9;
          If I < 10 Then
          Begin
             If H < 20 Then
                Begin
                   Gotoxy(46,I + 12); Write(I,' + 9 =  ',I + 9);
                End
             Else
                Begin
                   Gotoxy(46,I + 12); Write(I,' + 9 =',I + 9);
                End;
             End
          Else
             Begin
                Gotoxy(45,I + 12); Write(I,' + 9 =  ',I + 9);
             End;
           I := I + 1;
          End;

    I := 1;
    While I < 11 Do
       Begin
          H := I + 10;
          If I < 10 Then
          Begin
             If H < 20 Then
                Begin
                   Gotoxy(60,I + 12); Write(I,' + 10 =  ',I + 10);
                End
             Else
                Begin
                   Gotoxy(60,I + 12); Write(I,' + 10 =',I + 10);
                End;
             End
          Else
             Begin
                Gotoxy(59,I + 12); Write(I,' + 10 =  ',I + 10);
             End;
           I := I + 1;
          End;
    Readkey;
End.

Selamat Mencoba, Semoga Bermanfaat :)
Fastabiqul Khairaats
Continue >>>

Script Program Pembayaran Barang di Toko


Program Pembayaran ini berfungsi untuk menghitung total belanja pelanggan di sebuah toko, sehingga mempermudah dan mempercepat proses pembayaran di kasir. Program dibuat menggunakan bahasa pemrograman Pascal.

Program BARANG;
Uses Crt;
Var
   nKode, nHrg, nTotal, Total,Kembali, nJmlh, nbyr, nkembali : real;
   Nama,pilih,Thank : Char;
   I : integer;
Begin
   For I:= 1 To 11 Do
   Begin
       Sound(262); Delay(300);
       Sound(294); Delay(300);
       Sound(330); Delay(300);
       Sound(350); Delay(300);
       Sound(392); Delay(300);
       Sound(440); Delay(300);
       Sound(494); Delay(300);
       Sound(526); Delay(500);
       NoSound; Delay(10);
       Sound(526); Delay(300);
       Sound(494); Delay(300);
       Sound(440); Delay(300);
       Sound(392); Delay(300);
       Sound(350); Delay(300);
       Sound(330); Delay(300);
       Sound(294); Delay(300);
       Sound(262); Delay(300);
    End;
    NoSound;

   pilih := 'y';
   while pilih = 'y' Do
   begin
      clrscr;
      gotoxy(32,2); write ('TOKO SUCCESS FOREVER');
      gotoxy(32,3); write ('====================');


      gotoxy(4,5); write ('Kode Barang     = ');readln(nKode);
      gotoxy(4,6); write ('Nama Barang     = ');readln(Nama);
      gotoxy(4,7); write ('Harga           = ');readln(nHrg);
      gotoxy(4,8); write ('Jumlah Beli     = ');readln(nJmlh);
      Total := nHrg * nJmlh;
      gotoxy(4,11); write ('Total           = ',Total:9:2);
      gotoxy(4,12); write ('Uang Bayar      =    ');readln(nbyr);
      Kembali := nbyr - total;
      gotoxy(4,13); write ('Yang Kembali    = ',Kembali:9:2);
      gotoxy (45,16); write('Mau Proses Lagi ? [Y/T] ');read(pilih);
      clrscr;
      gotoxy (32,12); write('----THANK YOU---- ');read(Thank);

      readln;
   end;
end.
Continue >>>

Script Program untuk Menghitung Luas Segitiga



Program ini dapat digunakan untuk menghitung luas segitiga dengan cara memasukkan alas dan tinggi segitiga. Setelah diproses maka akan muncul luas segitiga yang kita inginkan. Script ini merupakan script sederhana yang bertujuan untuk melatih kemampuan kita dalam menganalogikan sesuatu.

Program PasMath;
Uses Crt;
Const Phi = 3.14;
Var
  pjg,lbr,jari,alas,tinggi : real;
  luas,kel : real;
  pilih : integer;
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.

Selamat Mencoba, Semoga Bermanfaat :)
Continue >>>
 

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