Sistem Informasi Pembayaran Rekening Listrik
uses crt;
var
kode:integer;
jnsplg:string;
beban:real;
hargakwh:integer;
pembayaran:real;
pemakaian:real;
no:integer;
q:integer;
label
ulang;
begin
clrscr;
no:=1;
writeln('Informasi Pembayaran Rekening Listrik');
writeln('-----------------------------------------------------------------');
gotoxy(0,3);write('No');
gotoxy(5,3);write('Kode');
gotoxy(13,3);write('Jenis Pelanggan');
gotoxy(30,3);write('Beban');
gotoxy(40,3);write('Pemakaian');
gotoxy(55,3);write('Pembayaran');
writeln;
writeln('-----------------------------------------------------------------');
ulang:
gotoxy(0,3+no+1);write(no);
gotoxy(5,3+no+1);read(kode);
if (kode=1) then
begin
jnsplg:='RUMAH';
beban:=25000;
hargakwh:=3000;
end
else if(kode=2) then
begin
jnsplg:='TOKO';
beban:=50000;
hargakwh:=5000;
end
else if(kode=3) then
begin
jnsplg:='PABRIK';
beban:=10000;
hargakwh:=10000;
end;
gotoxy(13,3+no+1);write(jnsplg);
gotoxy(30,3+no+1);write(beban:0:0);
gotoxy(40,3+no+1);read(pemakaian);
pembayaran:=beban+hargakwh*pemakaian;
gotoxy(55,3+no+1);write(pembayaran:0:0);
gotoxy(63,3+no+1);
write('Lagi?');
readln(q);
no:=no+1;
if(q=1) then goto ulang;
readkey;
end.
var
kode:integer;
jnsplg:string;
beban:real;
hargakwh:integer;
pembayaran:real;
pemakaian:real;
no:integer;
q:integer;
label
ulang;
begin
clrscr;
no:=1;
writeln('Informasi Pembayaran Rekening Listrik');
writeln('-----------------------------------------------------------------');
gotoxy(0,3);write('No');
gotoxy(5,3);write('Kode');
gotoxy(13,3);write('Jenis Pelanggan');
gotoxy(30,3);write('Beban');
gotoxy(40,3);write('Pemakaian');
gotoxy(55,3);write('Pembayaran');
writeln;
writeln('-----------------------------------------------------------------');
ulang:
gotoxy(0,3+no+1);write(no);
gotoxy(5,3+no+1);read(kode);
if (kode=1) then
begin
jnsplg:='RUMAH';
beban:=25000;
hargakwh:=3000;
end
else if(kode=2) then
begin
jnsplg:='TOKO';
beban:=50000;
hargakwh:=5000;
end
else if(kode=3) then
begin
jnsplg:='PABRIK';
beban:=10000;
hargakwh:=10000;
end;
gotoxy(13,3+no+1);write(jnsplg);
gotoxy(30,3+no+1);write(beban:0:0);
gotoxy(40,3+no+1);read(pemakaian);
pembayaran:=beban+hargakwh*pemakaian;
gotoxy(55,3+no+1);write(pembayaran:0:0);
gotoxy(63,3+no+1);
write('Lagi?');
readln(q);
no:=no+1;
if(q=1) then goto ulang;
readkey;
end.