program peserta kursus

program peserta_kursus;
uses wincrt;
var
n,i,tot:longint;
nm,kd:array[1..10] of string;
no,byr:array[1..10] of longint;
begin
write(‘berapa jumlah data yang ingin di input?’);readln(n);
for i:=1 to n do
begin
write(‘nomor peserta : ‘);readln(no[i]);
write(‘nama peserta : ‘);readln(nm[i]);
write(‘kode kursus(po1/po2/po3) : ‘);readln(kd[i]);

if kd[i]=’po1′ then byr[i]:=350000 else
if kd[i]=’po2′ then byr[i]:=450000 else
if kd[i]=’po3’ then byr[i]:=600000;
end;
tot:=0;
for i:=1 to n do tot:=tot+byr[i];
clrscr;
writeln(‘ Daftar Peserta kursus’);
writeln(‘—————————————————————‘);
writeln(‘|’,’ nomor peserta ‘,’|’,’ nama peserta ‘,’|’,’ kode kursus ‘,’|’,’ biaya ‘,’|’);
writeln(‘—————————————————————‘);
for i:=1 to n do
writeln(‘|’,no[i]:15,’|’,nm[i]:20,’|’,kd[i]:13,’|’,byr[i]:10,’|’);
writeln(‘—————————————————————‘);
writeln(‘jumlah peserta : ‘,n);
writeln(‘total biaya yang diperoleh : ‘,tot);
end.

Iklan

Tinggalkan Balasan

Isikan data di bawah atau klik salah satu ikon untuk log in:

Logo WordPress.com

You are commenting using your WordPress.com account. Logout /  Ubah )

Foto Google+

You are commenting using your Google+ account. Logout /  Ubah )

Gambar Twitter

You are commenting using your Twitter account. Logout /  Ubah )

Foto Facebook

You are commenting using your Facebook account. Logout /  Ubah )

Connecting to %s

%d blogger menyukai ini: