Ezio_U1 Administrator Posts : 1160 Gold : 107412 Reputasi : 1366 Join date : 26.11.10 Age : 27 Lokasi : Belakangmu..
| Subyek: Pascal buah-buahan Thu 18 Apr 2013, 11:09 | |
| CREDITS TO ABI - Code:
-
Program Toko_buah; uses crt; var kode:string; harga,kg:integer; tot:real;
begin clrscr; writeln('========================================='); writeln(' TOKO BUAH '); writeln('========================================='); writeln(' Daftar buah-buahan: '); writeln(' A. Apel '); writeln(' Harga per KG : Rp.6000 '); writeln(' B. Jeruk '); writeln(' Harga per KG : Rp.8000 '); writeln(' C. Anggur '); writeln(' Harga per KG : Rp.9000 '); writeln(' D. Kiwi '); writeln(' Harga per KG : Rp.12000 '); writeln(' E. Pisang '); writeln(' Harga per KG : Rp.5000 '); writeln('========================================='); writeln(' '); write('Masukkan Kode Buah : ');readln(kode); case kode of 'A','a' begin writeln('Apel'); harga:=6000; end; 'B','b' begin writeln('Jeruk'); harga:=8000; end; 'C','c' begin writeln('Anggur'); writeln('Harga Per KG : Rp.9000'); harga:=9000; end; 'D','d' begin writeln('Kiwi'); writeln('Harga Per KG : Rp.12000'); harga:=12000; end; 'E','e' begin writeln('Pisang'); writeln('Harga Per KG : Rp.5000'); harga:=5000; end; write('Masukkan Jumlah Barang : ');readln(kg); write('Total Harga : ');readln(tot); tot:=harga*kg; writeln(' Terima Kasih'); readln; end. |
|