Skip to content

Penggunaan Record pada Turbo Pascal

April 27, 2009

uses crt;
type nilai = record
hari,tugas,umum,na : real;
end;
type mapel = record
kimia,basindo : nilai;
end;
type siswa = record
nama : string[25];
nis : string[3];
mp : mapel;
end;
var
i,n,a : byte;
student : array [1..100] of siswa;
stop : boolean;
b : string[4];
begin
stop := false;
Repeat
clrscr;
write(‘Banyak siswa : ‘); readln(n);
clrscr;
writeln(‘=======================================================================’);
writeln(‘NIS Nama Siswa Mata Pelajaran N.Hr N.Tgs N.Umum N.Akhir’);
writeln(‘———————————————————————–‘);
a:=4;
for i := 1 to n do
begin
with student[i] do
begin
readln(nis);
gotoxy(6,a);
readln(nama);
with mp do
begin
gotoxy(26,a);
writeln(‘Bahasa Indonesia’);
with basindo do
begin
gotoxy(44,a);
readln(hari);
gotoxy(50,a);
readln(tugas);
gotoxy(57,a);
readln(umum);
na:=(2*hari+tugas+3*umum)/6;
gotoxy(65,a);
writeln(na:3:2);
end;
with kimia do

Download source code lengkapnya di sini

Leave a Comment

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: