Listing Program :
program DataMahasiswa;
uses crt;
type MaKul = record
sem : char;
kode : string[3];
nmk : string[40];
sks : byte;
n : char;
end;
DaMa = record
nim : string[6];
nama : string[25];
al : string[30];
mak : array[1..14] of makul;
end;
var mhs : array[1..10] of DaMa;
kul : array[1..10] of byte;
i,j,x,y,jum,b,bobot,h,tsks,sXb : byte;
ips : real;
begin
clrscr;
i := 1;
writeln('SISTEM INFORMASI MAHASISWA');
write('Nomor Induk Mahasiswa : ');readln(mhs[i].nim);
repeat
write('Nama Mahasiswa : ');readln(mhs[i].nama);
write('Alamat Mahasiswa : ');readln(mhs[i].al);
writeln('Mata Kuliah yang diprogramkan':50);
jum := 0;j := 1;
repeat
write('Semester ke [1 sampai 8] : ');readln(mhs[i].mak[j].sem);
write('Kode Mata Kuliah : ');readln(mhs[i].mak[j].kode);
write('Nama Mata Kuliah : ');readln(mhs[i].mak[j].nmk);
write('Nilai yang diperoleh [A..E] : ');readln(mhs[i].mak[j].n);
write('Jumlah sks Mata Kuliah tersebut : ');readln(mhs[i].mak[j].sks);
jum := jum + mhs[i].mak[j].sks;
inc(kul[i]);
inc(j);
until jum > 20;
inc(i);
clrscr;
write('Nomor Induk Mahasiswa [x = selesai] : ');readln(mhs[i].nim);
until mhs[i].nim = 'x';
clrscr;
h:=8;
for y := 1 to i-1 do
begin
ips:=0;
writeln('No.pokok : ',mhs[y].nim);
writeln('Nama : ',mhs[y].nama);
writeln('Alamat : ',mhs[y].al);
writeln('Mata Kuliah yang diprogramkan':50);
for x:=1 to 65 do
write('=');
writeln;
writeln('|No| kodeMK | Nama matakuliah | sks | Nilai | s * b |');
for x:=1 to 65 do
write('=');
writeln;
tsks:=0; sXb:=0;
for x := 1 to kul[y] do
begin
gotoxy(1,h);write('|');gotoxy(4,h);write('|');
gotoxy(13,h);write('|');gotoxy(43,h);write('|');
gotoxy(49,h);write('|');gotoxy(57,h);write('|');
gotoxy(65,h);write('|');
gotoxy(2,h);write(x);
gotoxy(6,h);write(mhs[y].mak[x].sem,'-',mhs[y].mak[x].kode,mhs[y].mak[x].sks);
gotoxy(15,h);write(mhs[y].mak[x].nmk);
gotoxy(46,h);write(mhs[y].mak[x].sks);
gotoxy(53,h);write(mhs[y].mak[x].n);
case mhs[y].mak[x].n of
'A' : b:=4;
'B' : b:=3;
'C' : b:=2;
'D' : b:=1;
'E' : b:=0;
end;
bobot:=b*mhs[y].mak[x].sks;
sXb := sXb + bobot;
tsks := tsks + mhs[y].mak[x].sks;
gotoxy(61,h);write(bobot);
inc(h);
end;
ips := sXb / tsks;
writeln;
for x:=1 to 65 do
write('-');
gotoxy(30,h+1);write('JUMLAH');gotoxy(46,h+1);write(tsks);gotoxy(61,h+1);write(sXb);
writeln;
for x:=1 to 65 do
write('-');
writeln;
gotoxy(35,h+3);writeln('Indeks prestasi semester : ',ips:2:2);
writeln;
inc(h,12);
end;
readln;
end.
uses crt;
type MaKul = record
sem : char;
kode : string[3];
nmk : string[40];
sks : byte;
n : char;
end;
DaMa = record
nim : string[6];
nama : string[25];
al : string[30];
mak : array[1..14] of makul;
end;
var mhs : array[1..10] of DaMa;
kul : array[1..10] of byte;
i,j,x,y,jum,b,bobot,h,tsks,sXb : byte;
ips : real;
begin
clrscr;
i := 1;
writeln('SISTEM INFORMASI MAHASISWA');
write('Nomor Induk Mahasiswa : ');readln(mhs[i].nim);
repeat
write('Nama Mahasiswa : ');readln(mhs[i].nama);
write('Alamat Mahasiswa : ');readln(mhs[i].al);
writeln('Mata Kuliah yang diprogramkan':50);
jum := 0;j := 1;
repeat
write('Semester ke [1 sampai 8] : ');readln(mhs[i].mak[j].sem);
write('Kode Mata Kuliah : ');readln(mhs[i].mak[j].kode);
write('Nama Mata Kuliah : ');readln(mhs[i].mak[j].nmk);
write('Nilai yang diperoleh [A..E] : ');readln(mhs[i].mak[j].n);
write('Jumlah sks Mata Kuliah tersebut : ');readln(mhs[i].mak[j].sks);
jum := jum + mhs[i].mak[j].sks;
inc(kul[i]);
inc(j);
until jum > 20;
inc(i);
clrscr;
write('Nomor Induk Mahasiswa [x = selesai] : ');readln(mhs[i].nim);
until mhs[i].nim = 'x';
clrscr;
h:=8;
for y := 1 to i-1 do
begin
ips:=0;
writeln('No.pokok : ',mhs[y].nim);
writeln('Nama : ',mhs[y].nama);
writeln('Alamat : ',mhs[y].al);
writeln('Mata Kuliah yang diprogramkan':50);
for x:=1 to 65 do
write('=');
writeln;
writeln('|No| kodeMK | Nama matakuliah | sks | Nilai | s * b |');
for x:=1 to 65 do
write('=');
writeln;
tsks:=0; sXb:=0;
for x := 1 to kul[y] do
begin
gotoxy(1,h);write('|');gotoxy(4,h);write('|');
gotoxy(13,h);write('|');gotoxy(43,h);write('|');
gotoxy(49,h);write('|');gotoxy(57,h);write('|');
gotoxy(65,h);write('|');
gotoxy(2,h);write(x);
gotoxy(6,h);write(mhs[y].mak[x].sem,'-',mhs[y].mak[x].kode,mhs[y].mak[x].sks);
gotoxy(15,h);write(mhs[y].mak[x].nmk);
gotoxy(46,h);write(mhs[y].mak[x].sks);
gotoxy(53,h);write(mhs[y].mak[x].n);
case mhs[y].mak[x].n of
'A' : b:=4;
'B' : b:=3;
'C' : b:=2;
'D' : b:=1;
'E' : b:=0;
end;
bobot:=b*mhs[y].mak[x].sks;
sXb := sXb + bobot;
tsks := tsks + mhs[y].mak[x].sks;
gotoxy(61,h);write(bobot);
inc(h);
end;
ips := sXb / tsks;
writeln;
for x:=1 to 65 do
write('-');
gotoxy(30,h+1);write('JUMLAH');gotoxy(46,h+1);write(tsks);gotoxy(61,h+1);write(sXb);
writeln;
for x:=1 to 65 do
write('-');
writeln;
gotoxy(35,h+3);writeln('Indeks prestasi semester : ',ips:2:2);
writeln;
inc(h,12);
end;
readln;
end.
Jangan lupa tinggalkan pesan berupa saran dan kritik yang bermanfaat untuk blog ini. Untuk teman-teman yang hendak mencopy artikel ini untuk dipasang
pada blog atau web-nya, dengan sangat diharapkan untuk mencantumkan Link
keblog ini
sebagai sumber artikel sekaligus sebagai backlink untuk blog ini.
Terima kasih untuk pengertian dan kerjasamanya, mari berkembang bersama.
Tidak ada komentar:
Posting Komentar