You are on page 1of 6

TUGAS KOMPUTASI I

Oleh:

Jaenab Putri NIM. 1711011120007

Miftahul Jannah NIM. 1711011120009

Mustika Khadijah NIM. 1711011320009

PROGRAM STUDI MATEMATIKA

FAKULTAS MATEMATIKA DAN ILMU PENGETAHUAN ALAM

UNIVERSITAS LAMBUNG MANGKURAT

2018
LISTING
Program latihan_Record;
Uses crt;
Type matkul = record
nmk,kmk,grade : string;
jlhsks : byte;
tgs,uts,uas : integer;
na,bobot : real;
end;

mhs = record
nama,nim, prodi,smstr: string;
matakuliah : array [1..10] of matkul;
sks,a : integer;
ip,jlh1,jlh2 : real;
end;
var
data :array [1..10] of mhs;
i,z,n,jmk,pilih :integer;

procedure output;
begin
clrscr;
writeln(' ');
writeln;
for i:=1 to n do
with data [i] do
begin
writeln(' Nama : ',nama);
writeln(' NIM : ',nim);
writeln(' Semester : ',smstr);
writeln(' Jumlah Mata Kuliah : ',a);
writeln;
writeln(' |
======================================================================================|');
writeln(' | DATA NILAI MAHASISWA
|');
writeln(' |
======================================================================================|');
writeln(' |NO | MATA KULIAH | KODE MK | TUGAS | UTS | UAS |JMLH SKS| SKOR |GRADE|
BOBOT|');
writeln('
|--------------------------------------------------------------------------------------|');
for z:=1 to a do
with matakuliah [z] do
begin
writeln('
|',z,'|':3,nmk:13,'|':2,kmk:13,'|':1,tgs:5,'|':3,uts:5,'|':3,uas:6,'|':3,jlhsks:6,'|':3,na:4:2,'|':2
,grade:3,'|':3,bobot:2:2,'|':3);
end;
writeln(' | | | | | | | | | |
|');
writeln(' |
======================================================================================|');
writeln(' IP :',ip:2:2);
writeln(' Jumlah SKS yang bisa diambil : ',sks,' SKS');
readln;
end;
end;

procedure input;
begin
clrscr;
write (' Jumlah Mahasiswa : ');readln(n);
clrscr;
writeln(' ');
writeln(' MASUKKAN DATA MAHASISWA ');
writeln(' ----------------------- ');

for i:=1 to n do
with data [i] do
begin
writeln(' Mahasiswa Ke-',i);
writeln(' ---------------- ');
write (' Nama : ');readln(nama);
write (' NIM : ');readln(nim);
write (' Semester : ');readln(smstr);
write (' Jumlah Mata Kuliah : ');readln(a);
writeln;
jlh1 :=0;
jlh2 :=0;

for z:=1 to a do
begin
writeln(' Data Mata Kuliah ke- ',z);
with matakuliah [z] do
begin
write (' Nama Mata Kuliah : ');readln(nmk);
write (' Kode Mata Kuliah : ');readln(kmk);
write (' Tugas : ');readln(tgs);
write (' UTS : ');readln(uts);
write (' UAS : ');readln(uas);
write (' Jumlah SKS : ');readln(jlhsks);
writeln;
NA := ((0.3*tgs) + (0.3*uts) + (0.4*uas));
if (NA>=80) and (not(NA>100)) then grade:='A'else
if (NA>=77) and (not(NA>80)) then grade:='A-'else
if (NA>=75) and (not(NA>77)) then grade:='B+'else
if (NA>=70) and (not(NA>75)) then grade:='B'else
if (NA>=66) and (not(NA>70)) then grade:='B-'else
if (NA>=61) and (not(NA>66)) then grade:='C+'else
if (NA>=55) and (not(NA>61)) then grade:='C'else
if (NA>=50) and (not(NA>55)) then grade:='D+'else
if (NA>=40) and (not(NA>55)) then grade:='D'else
grade:='E';
if grade = ('A ') then bobot := 4 else
if grade = ('A-') then bobot := 3.75 else
if grade = ('B+') then bobot := 3.5 else
if grade = ('B ') then bobot := 3 else
if grade = ('B-') then bobot := 2.75 else
if grade = ('C+') then bobot := 2.5 else
if grade = ('C ') then bobot := 2 else
if grade = ('D+') then bobot := 1.5 else
if grade = ('D ') then bobot := 1 else
bobot:= 0;
jlh1 := (bobot*jlhsks);
jlh2 := jlhsks;
end
end;
ip :=jlh1/jlh2;
if ip> 3.50 then sks := 24 else
if ip> 3.00 then sks := 22 else
if ip> 2.75 then sks := 21 else
if ip> 2.50 then sks := 20 else
if ip> 2.00 then sks := 18 else
sks := 16;
end;
end;
begin
repeat
clrscr;
writeln;
writeln('|==============================|');
writeln('| DATA NILAI MAHASISWA |');
writeln('|==============================|');
writeln('| |');
writeln('| 1. Input Data Mahasiswa |');
writeln('| 2. Tampilan Data Mahasiswa |');
writeln('| 3. Keluar |');
writeln('|==============================|');
writeln(' ');
write ('Masukkan Pilihan [1/2/3] ? : ');readln(pilih);
case pilih of
1 : input;
2 : output;
3 : exit;
end;
until pilih=3;
end.
end;
Readln;
end.
INPUT

OUTPUT

You might also like