Kabar Terbaru


Contoh Program Sederhana - Menentukan Nilai Tukar Mata Uang Rupiah Di Pascal (Metode IF Tunggal)
Nilai Tukar Mata Uang - Pascal

program Nilai_Tukar_Rupiah;
uses Crt;

var
nilaiuang:longint;
uang1,uang2,uang3,uang4,uang5,uang6,uang7,uang8,uang9,uang10,uang11,uang12,uang13:Integer;
sisa1,sisa2,sisa3,sisa4,sisa5,sisa6,sisa7,sisa8,sisa9,sisa10,sisa11,sisa12,sisa13:LongInt;

begin
clrscr;
textcolor(10);
WriteLn('|== PROGRAM NILAI TUKAR - METODE IF TUNGGAL ==|');
WriteLn('||            By : Ronny Liem                ||');
WriteLn('|=============================================|');
Write  ('>> Masukan Nilai Uang :'); ReadLn(nilaiuang);
if nilaiuang > 0 then
Uang1:=nilaiuang div 100000;
Sisa1:=nilaiuang mod 100000;
Uang2:=Sisa1 div 50000;
Sisa2:=Sisa1 mod 50000;
Uang3:=Sisa2 div 20000;
Sisa3:=Sisa2 mod 20000;
Uang4:=Sisa3 div 10000;
Sisa4:=Sisa3 mod 10000;
Uang5:=Sisa4 div 5000;
Sisa5:=Sisa4 mod 5000;
Uang6:=Sisa5 div 2000;
Sisa6:=Sisa5 mod 2000;
Uang7:=Sisa6 div 1000;
Sisa7:=Sisa6 mod 1000;
Uang8:=Sisa7 div 500;
Sisa8:=Sisa7 mod 500;
Uang9:=Sisa8 div 200;
Sisa9:=Sisa8 mod 200;
Uang10:=Sisa9 div 100;
Sisa10:=Sisa9 mod 100;
Uang11:=Sisa10 div 50;
Sisa11:=Sisa10 mod 50;
Uang12:=Sisa11 div 25;
Sisa12:=Sisa11 mod 25;
Uang13:=Sisa12 div 1;
Sisa13:=Sisa12 mod 1;
WriteLn('|=============================================|');
WriteLn('    100.000 : ' , Uang1);
WriteLn('     50.000 : ' , Uang2);
WriteLn('     20.000 : ' , Uang3);
WriteLn('     10.000 : ' , Uang4);
WriteLn('      5.000 : ' , Uang5);
WriteLn('      2.000 : ' , Uang6);
WriteLn('      1.000 : ' , Uang7);
WriteLn('        500 : ' , Uang8);
WriteLn('        200 : ' , Uang9);
WriteLn('        100 : ' , Uang10);
WriteLn('         50 : ' , Uang11);
WriteLn('         25 : ' , Uang12);
WriteLn('          1 : ' , Uang13);
WriteLn('|    THANKS YOU FOR USING MY SIMPLE PROGRAM   |');

ReadLn;

end.


Subscribe to receive free email updates:

0 Response to "Contoh Program Sederhana - Menentukan Nilai Tukar Mata Uang Rupiah Di Pascal (Metode If Tunggal)"

Post a Comment