Sabtu, 30 Juli 2011

Program Menu Pilihan Pascal

Program Studi_Kasus;
uses wincrt;
label
     lagi;
var p,l,a,TB,s1,s2,s3,x,n : integer;
    tanya: char;
    BI,BB,luas,kll,harga, diskon, total   : real;
    ket: string;
begin

clrscr;
lagi:
gotoxy(28,3);  writeln  ( 'UJIAN TENGAH SEMESTER')  ;
gotoxy(28,4);  writeln  ( 'PALCOMTECH PALEMBANG'  ) ;
gotoxy(21,5);  writeln  ( '===================================');
gotoxy(23,6);  writeln  ( 'Hari/Tanggal : SENIN/ 24 MEI 2011');
gotoxy(23,7);  writeln  ( 'Pukul        : 11.00 WIB-14.50 WIB');
gotoxy(10,8);  writeln  ( '------------------------------------------------------------');
gotoxy(16,9);  WRITEln  ( 'Nama                : Aditya Mellizar '                 );
gotoxy(16,10); WRITEln  ( 'NIM                 : 0734934'                          );
gotoxy(16,11); WRITEln  ( 'Tempat/Tgl. Lahir   : Tanjung Enim/15 Juni 1989 '       );
gotoxy(16,12); WRITEln  ( 'Alamat              : Jl Srijaya Negara Asrama Brimob ' );
Gotoxy(10,13); WRITEln  ('=============================================================');
readln;

clrscr;
clrscr;
GotoXY(20,3); writeln ('Silahkan Masukkan Pilihan Anda');
GotoXY(15,4); writeln ('*========================================*');
GotoXY(15,5); writeln ('1.Berat Badan Ideal                       ');
GotoXY(15,6); writeln ('2.Pembacaan Sebuah Angka                  ');
GotoXY(15,7); writeln ('3.Penentuan Diskon Belanja                ');
GotoXY(15,8); writeln ('==========================================');
GotoXY(15,9); write   ('Pilihan Anda: '                            );
              readln (n);
writeln;

         if n=1 then               
         begin
         clrscr;
           writeln ('Menghitung Berat Badan Ideal');
           writeln ('============================================');
           write ('Berat Badan: '); readln(BB);
           write ('Tinggi Badan:  '); readln(TB);
             BI:=(TB-100)-(10/100-(TB-100)) ;
             if BB-BI >= 3 then
                ket:='Tidak Ideal'
             else
             if BB-BI <3 then
                ket:='Ideal';
             
           writeln ('Berat Badan Ideal= ',BI:2:2);
           writeln ('Keterangan: ',ket);
             readln;
        end
      else
      if n=2 then
      Begin
      clrscr;
      writeln ('Pembacaan Sebuah Angka');
      writeln ('============================');
      Write ('Masukkan nilai dari: ');
      Readln (x);
      Case x of
            1 : writeln ('Satu');
            2 : writeln ('Dua');
            3 : writeln ('Tiga');
            4 : writeln ('Empat');
            5 : writeln ('Lima');
            6 : writeln ('Enam');
            7 : writeln ('Tujuh');
            8 : writeln ('Delapan');
            9 : writeln ('Sembilan');
            10 : writeln ('Sepuluh');
else
writeln ('Masukkan nilai yang benar..!');
end;
end
else

    if n=3 then
    begin
    clrscr;
       writeln ('MENGHITUNG DISKON DAN TOTAL HARGA BELANJA');
       writeln ('=========================================');
       write   ('Masukkan Jumlah Harga : Rp ' ); readln (harga);

if harga >= 1500000 then
begin
writeln('Mendapat Diskon 20%');
diskon := harga * 0.2; total := harga - diskon; end
else


if harga <= 500000 then
begin
writeln('Mendapat Diskon 10%');
diskon := harga * 0.1; total := harga - diskon; end;


write ('Jumlah diskon : Rp ', diskon:0:0); readln;
write ('Jumlah Harga Setelah Diskon    : Rp ', total :0:0 ); readln;

  end
  else
  begin
       Gotoxy(20,16); writeln('Pilihan Anda Tidak ada di Menu...');
  end;

       writeln;
       write ('Mau menghitung lagi [Y/T] ? '); readln(tanya);
  if tanya=upcase('y') then
  begin
       clrscr;
       goto lagi;
  end
  else
       clrscr;
       gotoxy(30,10); writeln ('Terima Kasih ^_^');
  readln;
end.

Hasilnya :































Download source code & demo Program Menu Pilihan Pascal (14.51 KB)



Related Post

0 komentar:

Posting Komentar

Mohon tinggalkan jejak/komentar sobat disini. Dilarang SPAM. Okey...