Halo.. para bloger!!, terima kasih telah berkunjung ke blog saya ini. Kali ini saya memposting sebuah artikel yang berjudul "Program Data Nilai Mahasiswa" yang dibuat dengan menggunakan program pascal. Langsung saja beginiliah hasil codingan progamnya:
A. Source Code
program Data_Nilai_Mahasiswa;
uses crt;
type mhs = record
nm,nim:string[16];
Nk : integer;
Nh : String;
end;
var dtmhs :array[1..50] of mhs;
n,i,b,pil: integer;
procedure input;
begin
clrscr;
writeln('Masukkan Data Mahasiswa');
writeln;
write('Masukkan Jumlah Data : ');readln(n);
for i:=1 to n do
begin
writeln;
write('Nama : ');readln(dtmhs[i].nm);
write('NIM : ');readln(dtmhs[i].nim);
write('Nilai : ');readln(dtmhs[i].Nk);
if dtmhs[i].Nk>=85 then dtmhs[i].Nh:='A'
else if dtmhs[i].Nk>=75 then dtmhs[i].Nh:='B+'
else if dtmhs[i].Nk>=65 then dtmhs[i].Nh:='B'
else if dtmhs[i].Nk>=55 then dtmhs[i].Nh:='C+'
else if dtmhs[i].Nk>=45 then dtmhs[i].Nh:='C'
else if dtmhs[i].Nk>=35 then dtmhs[i].Nh:='D+'
else if dtmhs[i].Nk>=25 then dtmhs[i].Nh:='D'
else dtmhs[i].Nh:='E';
end;
end;
procedure output;
begin
clrscr;
writeln;
writeln('--------------------------------------------------------------------');
writeln('| No | Nama Mahasiswa | NIM | Nilai Angka | Nilai Huruf |');
writeln('--------------------------------------------------------------------');
for i:=1 to n do
begin
writeln('| | | | | |');
gotoxy(3,i+4); writeln(i);
gotoxy(8,i+4); writeln(dtmhs[i].nm);
gotoxy(27,i+4);writeln(dtmhs[i].nim);
gotoxy(45,i+4);writeln(dtmhs[i].Nk);
gotoxy(61,i+4);writeln(dtmhs[i].Nh);
end;
writeln('--------------------------------------------------------------------');
readln;
end;
begin
repeat
clrscr;
writeln(' Menu Utama ');
writeln;
writeln('[1] Masukkan Data Mahasiswa');
writeln('[2] Lihat Data');
writeln('[0] Keluar');
writeln;
write('Pilihan : ');readln(pil);
case pil of
1 : input;
2 : output;
end;
until pil=0;
end.
uses crt;
type mhs = record
nm,nim:string[16];
Nk : integer;
Nh : String;
end;
var dtmhs :array[1..50] of mhs;
n,i,b,pil: integer;
procedure input;
begin
clrscr;
writeln('Masukkan Data Mahasiswa');
writeln;
write('Masukkan Jumlah Data : ');readln(n);
for i:=1 to n do
begin
writeln;
write('Nama : ');readln(dtmhs[i].nm);
write('NIM : ');readln(dtmhs[i].nim);
write('Nilai : ');readln(dtmhs[i].Nk);
if dtmhs[i].Nk>=85 then dtmhs[i].Nh:='A'
else if dtmhs[i].Nk>=75 then dtmhs[i].Nh:='B+'
else if dtmhs[i].Nk>=65 then dtmhs[i].Nh:='B'
else if dtmhs[i].Nk>=55 then dtmhs[i].Nh:='C+'
else if dtmhs[i].Nk>=45 then dtmhs[i].Nh:='C'
else if dtmhs[i].Nk>=35 then dtmhs[i].Nh:='D+'
else if dtmhs[i].Nk>=25 then dtmhs[i].Nh:='D'
else dtmhs[i].Nh:='E';
end;
end;
procedure output;
begin
clrscr;
writeln;
writeln('--------------------------------------------------------------------');
writeln('| No | Nama Mahasiswa | NIM | Nilai Angka | Nilai Huruf |');
writeln('--------------------------------------------------------------------');
for i:=1 to n do
begin
writeln('| | | | | |');
gotoxy(3,i+4); writeln(i);
gotoxy(8,i+4); writeln(dtmhs[i].nm);
gotoxy(27,i+4);writeln(dtmhs[i].nim);
gotoxy(45,i+4);writeln(dtmhs[i].Nk);
gotoxy(61,i+4);writeln(dtmhs[i].Nh);
end;
writeln('--------------------------------------------------------------------');
readln;
end;
begin
repeat
clrscr;
writeln(' Menu Utama ');
writeln;
writeln('[1] Masukkan Data Mahasiswa');
writeln('[2] Lihat Data');
writeln('[0] Keluar');
writeln;
write('Pilihan : ');readln(pil);
case pil of
1 : input;
2 : output;
end;
until pil=0;
end.
B. Screenshot Program
Gambar 1. Tampilan awal program
Gambar 2. Tampilan sesudah memilih pilihan 1
Gambar 3. Tampilan sesudah menginput data
Gambar3. Tampilan output hasil Data Nilai Mahasiswa
Sekian postingan saya pada kesempatan kali ini, semoga artikel ini bermanfaat bagi kalian para bloger semua. Terima kasih telah berkunjung...
Tidak ada komentar:
Posting Komentar