Pertemuan Ke 3 Tanggal 7 Maret 2012
SEMESTER 2D
Tugas 2:
- Buat Program Menampilkan Rincian Uang.
PROGRAM RINCIAN_TRANSAKSI_NASRUL_NISA;
USES WINCRT;
VAR
NAMA,O:STRING;
A,B,C,D,E,F,G,H,I,J,K,L,M,N,P,Q,R,S,T,U,V,W,X,Y,Z:LONGINT;
BEGIN
REPEAT;
CLRSCR;
WRITELN('SELAMAT DATANG');
WRITELN;
WRITE('MASUKKAN NAMA : '); READLN(NAMA);
WRITE('HABIS BERAPA : '); READLN(A);
WRITE('JUMLAH TERIMA UANG : '); READLN(B);
C:=B-A;
IF C<0 THEN WRITELN('RINCIAN KURANG : ',C);
D :=C MOD 100000;
P :=C DIV 100000;
E :=D MOD 50000;
Q :=D DIV 50000;
F :=E MOD 20000;
R :=E DIV 20000;
G :=F MOD 10000;
S :=F DIV 10000;
H :=G MOD 5000;
T :=G DIV 5000;
I :=H MOD 2000;
U :=H DIV 2000;
J :=I MOD 1000;
V :=I DIV 1000;
K :=J MOD 500;
W :=J DIV 500;
L :=K MOD 200;
X :=K DIV 200;
M :=L MOD 100;
Y :=L DIV 100;
N :=M MOD 50;
Z :=M DIV 50;
IF P>0 THEN WRITELN('LEMBAR RP. 100.000,- = ',P);
IF Q>0 THEN WRITELN('LEMBAR RP. 50.000,- = ',Q);
IF R>0 THEN WRITELN('LEMBAR RP. 20.000,- = ',R);
IF S>0 THEN WRITELN('LEMBAR RP. 10.000,- = ',S);
IF T>0 THEN WRITELN('LEMBAR RP. 5.000,- = ',T);
IF U>0 THEN WRITELN('LEMBAR RP. 2.000,- = ',U);
IF V>0 THEN WRITELN('LEMBAR/LOGAM RP. 1.000,- = ',V);
IF W>0 THEN WRITELN('LOGAM RP. 500,- = ',W);
IF X>0 THEN WRITELN('LOGAM RP. 200,- = ',X);
IF Y>0 THEN WRITELN('LOGAM RP. 100,- = ',Y);
IF Z>0 THEN WRITELN('LOGAM RP. 50,- = ',Z);
WRITELN;
WRITELN('SISA UANG : ',C:7);
IF Z<=1 THEN Z:=50;
BEGIN
WRITELN('PEMBULATAN : ',Z:7);
C:=C-Z;
WRITELN('TOTAL SISA UANG : ',C:7);
END;
WRITELN;
WRITELN('KET : <100 DI BULATKAN');
WRITELN;
IF C<0 THEN
BEGIN
WRITELN('MAAF UANG ANDA KURANG ',C);
WRITELN('SEGERA DILUNASI / BARANG ANDA TIDAK DAPAT DIBAWA PULANG');
END;
WRITELN;
WRITELN('TERIMA KASIH ATAS KUNJUNGANNYA');
WRITELN('---( ',NAMA,' )---');
WRITELN;
WRITELN;
WRITE ('COBA LAGI? (Y/N) : '); READLN (O);
UNTIL (O='N') OR (O='n');
END.
Hasil Prt Scr (Print Screen) :