Pertemuan Ke 3 Tanggal 7 Maret 2012
SEMESTER 2D
Tugas 2:
- Buat Program Menampilkan Rincian Uang
PROGRAM RINCIAN_TRANSAKSI_RODIKYA;
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('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(P, ' LEMBAR RP. 100.000,-');
IF Q>0 THEN WRITELN(Q, ' LEMBAR RP. 50.000,-');
IF R>0 THEN WRITELN(R, ' LEMBAR RP. 20.000,-');
IF S>0 THEN WRITELN(S, ' LEMBAR RP. 10.000,-');
IF T>0 THEN WRITELN(T, ' LEMBAR RP. 5.000,-');
IF U>0 THEN WRITELN(U, ' LEMBAR RP. 2.000,-');
IF V>0 THEN WRITELN(V, ' LEMBAR/LOGAM RP. 1.000,-');
IF W>0 THEN WRITELN(W, ' LOGAM RP. 500,-');
IF X>0 THEN WRITELN(X, ' LOGAM RP. 200,-');
IF Y>0 THEN WRITELN(Y, ' LOGAM RP. 100,-');
IF Z>0 THEN WRITELN(Z, ' LOGAM RP. 50,-');
WRITELN;
WRITELN('SISA UANG : ',C:6);
IF Z<=1 THEN Z:=50;
BEGIN
WRITELN('PEMBULATAN : ',Z:6);
C:=C-Z;
WRITELN('TOTAL SISA UANG : ',C:6);
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 TELAH BERKUNJUNG');
WRITELN('---( ',NAMA,' )---');
WRITELN;
WRITELN;
WRITE ('INGIN COBA LAGI? (Y/N) : '); READLN (O);
UNTIL (O='N') OR (O='n');
END.
Tidak ada komentar:
Posting Komentar