Ac Milan numero uno

Ac Milan numero uno
best picture

Thursday, 18 November 2010

Contoh program pascal record

program recort;
uses crt;
type
mahasiswa=record
nama:string [20];
UTS,UAS:integer;
end;
var
mhs: mahasiswa;
Grade : char;
begin
clrscr ;
write (‘ Masukan Nama : ‘ ) ; readln (mhs.nama) ;
write(‘ Nilai UTS : ‘ ); readln (mhs.UTS);
Write( ‘ Nilai UAS : ‘ ) ; readln (mhs.UAS);
writeln;
writeln (‘ Nama : ‘,mhs.nama);
writeln (‘ Nilai akhir : ‘,mhs.UTS*mhs.UAS/2);
begin
if mhs.UTS*mhs.UAS/2 >=80 then Grade:=’A’
else
if mhs.UTS*mhs.UAS/2 >=60 then Grade:=’B’
else
if mhs.UTS*mhs.UAS/2 >=50 then Grade:=’C’
else
if mhs.UTS*mhs.UAS/2 >=40 then Grade:=’D’
else
Grade :=’E’;
writeln (‘ Grade : ‘,Grade );
readln;
end;
end.

No comments:

Post a Comment