Contoh Program Konversi Mata Uang Asing Ke Rupiah
% konversi mata uang asing ke rupiah
kurs(euro,17393.48).
kurs(dolar,14615.40).
kurs(rm,3522.34).
kurs(ds,10892.46).
%aturan
cek:-
kurs(euro,Euro),
kurs(dolar,DolarAs),
kurs(rm,Rm),
kurs(ds,Ds),
write(" --------------------------------- "),nl,
write("| Nilai tukar hari ini |"),nl,
write(" --------------------------------- "),nl,
write("| nama mata uang | nilai rupiah |"),nl,
write(" --------------------------------- "),nl,
write("| Euro | 17393.48 |"),nl,
write(" --------------------------------- "),nl,
write("| Dollar As | 14615.40 |"),nl,
write(" --------------------------------- "),nl,
write("| Ringgit Malaysia | 3522.34 |"),nl,
write(" --------------------------------- "),nl,
write("| Dollar Singapura | 10892.46 |"),nl,
write(" --------------------------------- "),nl,
write(" Masukkan nilai yang akan ditukar: "),read(Nilai),
write(" Nilai yang anda tukar adalah : "), write(Nilai),nl,
KEuro is Euro*Nilai,
KDolarAs is DolarAs*Nilai,
KRm is Rm*Nilai,
KDs is Ds*Nilai,
write(" Hasil tukar "),nl,
write(" Euro ke rupiah : "),write(KEuro),nl,
write(" Dollar As ke rupiah : "),write(KDolarAs),nl,
write(" Ringgit Malaysia ke rupiah: "),write(KRm),nl,
write(" Dollar Singapura : "),write(KDs).
No comments:
Post a Comment
Note: only a member of this blog may post a comment.