program delphi
program Project2;
{$APPTYPE CONSOLE}
uses
SysUtils;
var kodebarang :
array [1..100] of string;
namabarang :
array [1..100] of string;
jumlah : array [1..100] of integer;
harga : array [1..100] of integer;
totalharga :
array [1..100] of integer;
i, n : integer;
begin
write ('isikan
banyak data:'); readln (n);
for i:=1 to n do
begin
write ('isikan
kodebarang data ke',i,':'); readln (kodebarang[i]);
write ('isikan
namabarang:'); readln (namabarang[i]);
write ('isikan
jumlah:'); readln (jumlah[i]);
write ('isikan
harga:'); readln (harga[i]);
totalharga[i]:=jumlah[i]*harga[i];
writeln;
end;
writeln;
for i:=1 to n do
writeln
('kodebarang[i],'',namabarang[i],'',jumlah[i],'',harga[i],'',totalharga[i]');
writeln;
write ('tekan enter uuntuk selesai');
readln;
end.
Komentar
Posting Komentar