program TUGAS1_DAA;
uses crt;
var
nilai : longint;
begin
writeln ('KULIAH SEMESTER PENDEK' );
writeln ('TUGAS DESAIN ANALISIS DAN ALGORITMA ');
writeln ('NOVI YARNI ');
writeln ('G1A007016 ');
writeln ('=================================== ');
writeln('');
writeln('MATA UANG : 100000,50000,20000,10000,5000,2000,1000,500,200,100,50,25,5,2,1');
writeln ('SILAKAN MASUKKAN NILAI MATA UANG YANG DITUKAR : ');
readln(nilai);
if nilai div 100000 > 0 then
begin
writeln(nilai div 100000,' lembar = 100000');
nilai := nilai mod 100000;
end;
if nilai div 50000 > 0 then
begin
writeln(nilai div 50000,' lembar = 50000');
nilai := nilai mod 50000;
end;
if nilai div 20000 > 0 then
begin
writeln(nilai div 20000,' lembar = 20000');
nilai := nilai mod 20000;
end;
if nilai div 10000 > 0 then
begin
writeln(nilai div 10000,' lembar = 10000');
nilai := nilai mod 10000;
end;
if nilai div 5000 > 0 then
begin
writeln(nilai div 5000,' lembar = 5000');
nilai := nilai mod 5000;
end;
if nilai div 2000 > 0 then
begin
writeln(nilai div 2000,' lembar = 2000');
nilai := nilai mod 2000;
end;
if nilai div 1000 > 0 then
begin
writeln(nilai div 1000,' lembar/koin = 1000');
nilai := nilai mod 1000;
end;
if nilai div 500 > 0 then
begin
writeln(nilai div 500,' koin = 500');
nilai := nilai mod 500;
end;
if nilai div 200 > 0 then
begin
writeln(nilai div 200,' koin = 200');
nilai := nilai mod 200;
end;
if nilai div 100 > 0 then
begin
writeln(nilai div 100,' koin = 100');
nilai := nilai mod 100;
end;
if nilai div 50 > 0 then
begin
writeln(nilai div 50,' koin = 50');
nilai := nilai mod 50;
end;
if nilai div 25 > 0 then
begin
writeln(nilai div 25,' koin = 25');
nilai := nilai mod 25;
end;
if nilai div 10 > 0 then
begin
writeln(nilai div 10,' koin = 10');
nilai := nilai mod 10;
end;
if nilai div 5 > 0 then
begin
writeln(nilai div 5,' koin = 5');
nilai := nilai mod 5;
end;
if nilai div 2 > 0 then
begin
writeln(nilai div 2,' koin = 2');
nilai := nilai mod 2;
end;
if nilai div 1 > 0 then
begin
writeln(nilai div 1,' koin = 1');
nilai := nilai mod 1;
end;
writeln ('tekan Enter untuk kembali ');
readln;
end.
Nostalgia Siomay Mandiri dan Doa Ibu
1 tahun yang lalu
1 komentar:
kunjungi blogku yah
http://raici.blogspot.com
Posting Komentar