PERTEMUAN KE 3 TANGGAL 7 MARET 2012
SEMESTER 2D
TUGAS 2:
- Buat Program Menampilkan Rincian Uang.
- Program Untuk Menampilkan Rincian Uang
PROGRAM DETAIL_MONEY;
USES WINCRT;
VAR
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
WRITELN('HOW MUCH MONEY DO YOU GET BACK ??');
WRITELN;
WRITE('Total Payment = '); readln(A);
WRITE('Cash Payment = '); readln(B);
C:=B-A;
WRITELN('Cash Back = ',C);
WRITELN('With Detail Money As Below :');
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('100000 =',P);
IF Q>0 THEN WRITELN('50000 =',Q);
IF R>0 THEN WRITELN('20000 =',R);
IF S>0 THEN WRITELN('10000 =',S);
IF T>0 THEN WRITELN('5000 =',T);
IF U>0 THEN WRITELN('2000 =',U);
IF V>0 THEN WRITELN('1000 =',V);
IF W>0 THEN WRITELN('500 =',W);
IF X>0 THEN WRITELN('200 =',X);
IF Y>0 THEN WRITELN('100 =',Y);
IF Z>0 THEN WRITELN('50 =',Z);
WRITELN;
WRITELN('Thank You, :)');
END.
2. Layout Program
Tidak ada komentar:
Posting Komentar