Program Transkrip Nilai Mahasiswa
dengan Type data Record
program
Transkrip_nilai;
uses
crt;
type
Nilai_kuliah = record
Tugas,UTS,UAS,Angka :
real;
Mutu : string;
end;
type
mata_kuliah = record
kode_mk : string;
nama_mk : string;
nilai : array [1..2] of Nilai_kuliah;
end;
type
mahasiswa = record
NIM : string[11];
nama_mhs : string;
pro_stu : string;
Fklts : string;
mk : array[1..2] of mata_kuliah;
end;
type
data_mahasiswa = array [1..20] of mahasiswa;
var
mhs :
data_mahasiswa;
jmlh_mhs,i,j,k,p,q,jmlh_mk,indeks : integer;
Angka : real;
NIM : string;
begin
clrscr;
clrscr;
write('Jumlah Mahasiswa : '); readln(jmlh_mhs);
write('Jumlah Mata Kuliah : '); readln(jmlh_mk);
writeln;
for i:=1 to jmlh_mhs do
begin
write(i,'. ');
write('NIM : '); readln(mhs[i].NIM);
write(' Nama Mahasiswa : '); readln(mhs[i].nama_mhs);
write(' Program Studi : '); readln(mhs[i].pro_stu);
write(' Fakultas : '); readln(mhs[i].fklts);
writeln;
for j:=1 to jmlh_mk do
begin
write(' ',j,'. ');
write('Kode Mata Kuliah :
');readln(mhs[i].mk[j].kode_mk);
write(' Nama Mata Kuliah :
');readln(mhs[i].mk[j].nama_mk);
write(' Nilai ');
writeln;
write(' 1. Nilai Tugas : ');readln(mhs[i].mk[j].nilai[j].Tugas);
write(' 2. Nilai UTS : ');readln(mhs[i].mk[j].nilai[j].UTS);
write(' 3. Nilai UAS : ');readln(mhs[i].mk[j].nilai[j].UAS);
mhs[i].mk[j].nilai[j].Angka:=(0.3*mhs[i].mk[j].nilai[j].Tugas)+(0.35*mhs[i].mk[j].nilai[j].UTS)+(0.35*mhs[i].mk[j].nilai[j].UAS);
write(' 4. Nilai Angka : ');writeln(mhs[i].mk[j].nilai[j].Angka:0:2);
if
(mhs[i].mk[j].nilai[j].Angka>=80) then
mhs[i].mk[j].nilai[j].Mutu:='A' else
if
(mhs[i].mk[j].nilai[j].Angka<80)and(mhs[i].mk[j].nilai[j].Angka>=75) then
mhs[i].mk[j].nilai[j].Mutu:='B+' else
if
(mhs[i].mk[j].nilai[j].Angka<73)and(mhs[i].mk[j].nilai[j].Angka>=65) then
mhs[i].mk[j].nilai[j].Mutu:='B' else
if
(mhs[i].mk[j].nilai[j].Angka<65)and(mhs[i].mk[j].nilai[j].Angka>=60) then
mhs[i].mk[j].nilai[j].Mutu:='C+' else
if
(mhs[i].mk[j].nilai[j].Angka<60)and(mhs[i].mk[j].nilai[j].Angka>=55) then
mhs[i].mk[j].nilai[j].Mutu:='C' else
if
(mhs[i].mk[j].nilai[j].Angka<55)and(mhs[i].mk[j].nilai[j].Angka>=45) then
mhs[i].mk[j].nilai[j].Mutu:='D' else
mhs[i].mk[j].nilai[j].Mutu:='E';
write(' 5. Nilai Mutu : ',mhs[i].mk[j].nilai[j].Mutu);
writeln;
end;
writeln;
end;
write ('NIM Mahasiswa: ');readln(NIM);
indeks:=0;
for
i:=1 to jmlh_mhs do
begin
if (mhs[i].NIM=NIM) then
indeks:=i;
end;
if (indeks=0) then writeln('data tidak
ditemukan')
else
begin
writeln;
writeln('Nama
Mahasiswa : ',mhs[i].nama_mhs);
writeln('NIM : ',mhs[i].NIM);
writeln('Program
Studi : ',mhs[i].pro_stu);
writeln('Fakultas : ',mhs[i].fklts);
writeln('Kode
Mata Kuliah Nama Mata Kuliah Nilai Tugas
Nilai UTS Nilai UAS Nilai Angka
Nilai Mutu');
for
j:=1 to jmlh_mk do
writeln(' ',mhs[i].mk[j].kode_mk,' ',mhs[i].mk[j].nama_mk,' ',
mhs[i].mk[j].nilai[j].Tugas:0:2,' ',mhs[i].mk[j].nilai[j].UTS:0:2,' ',
mhs[i].mk[j].nilai[j].UAS:0:2,' ',mhs[i].mk[j].nilai[j].Angka:0:2,' ',
mhs[i].mk[j].nilai[j].Mutu);
end;
readln;
end.
Tidak ada komentar:
Posting Komentar