--------------------------------------------------------------------------------------------------------------------------
Algoritma Pecahan_Uang
{I.S: Diinputkan sejumlah uang rupiah oleh user}
{F.S: Menampilkan detail penukaran uang terhadap rupiah}
Kamus:
uang : integer
a,b,c,d,e,f,g,h,i,j,k : integer //pecahan rupiah
sisa : integer
Algoritma:
input(uang)
//proses pemecahan uang
a <= uang div 100000
sisa <= uang mod 100000
b <= sisa div 50000
sisa <= sisa mod 50000
c <= sisa div 20000
sisa <= sisa mod 20000
d <= sisa div 10000
sisa <= sisa mod 10000
e <= sisa div 5000
sisa <= sisa mod 5000
f <= sisa div 2000
sisa <= sisa mod 2000
g <= sisa div 1000
sisa <= sisa mod 1000
h <= sisa div 500
sisa <= sisa mod 500
i <= sisa div 200
sisa <= sisa mod 200
j <= sisa div 100
sisa <= sisa mod 100
k <= sisa div 50
sisa <= sisa mod 50
output(a,b,c,d,e,f,g,h,i,j,sisa)
--------------------------------------------------------------------------------------------------------------------------
Algoritma Pecahan_Uang
{I.S: Diinputkan sejumlah uang rupiah oleh user}
{F.S: Menampilkan detail penukaran uang terhadap rupiah}
Kamus:
uang : integer
a,b,c,d,e,f,g,h,i,j,k : integer //pecahan rupiah
sisa : integer
Algoritma:
input(uang)
//proses pemecahan uang
a <= uang div 100000
sisa <= uang mod 100000
b <= sisa div 50000
sisa <= sisa mod 50000
c <= sisa div 20000
sisa <= sisa mod 20000
d <= sisa div 10000
sisa <= sisa mod 10000
e <= sisa div 5000
sisa <= sisa mod 5000
f <= sisa div 2000
sisa <= sisa mod 2000
g <= sisa div 1000
sisa <= sisa mod 1000
h <= sisa div 500
sisa <= sisa mod 500
i <= sisa div 200
sisa <= sisa mod 200
j <= sisa div 100
sisa <= sisa mod 100
k <= sisa div 50
sisa <= sisa mod 50
output(a,b,c,d,e,f,g,h,i,j,sisa)
--------------------------------------------------------------------------------------------------------------------------
Download Scriptnya :
catatan :
hargailah tulisan orang lain, jika anda mengcopy paste harap cantumkan link sumber.
0 komentar