Program ini merupakan program yang dibuat sebagai tugas dari matkul pemrog.dasar STIMIK ASIA
Program quis2;
Uses wincrt;
label menu;
const max=100;
type
dat=record
nama, nim, tgl,tmp,alm,mlg: string[30];
NA : integer;
end;
Var
m:integer;
D: array [1..max] of dat;
Y:string[30];
h,e,j,k,i: integer;
pilihan:char;
Procedure data;
begin
wRITELN('===========================================');
wRITELN(' INPUTAN DATA ');
wRITELN('===========================================');
Write('masukan banyaknya data:');readln(m);
wRITELN('-------------------------------------------');
for i:=1 to m do BEGIN
Write('NIM:');readln(D[i].nim);
Write('NAMA:');readln(D[i].nama);
Write('TEMPAT LAHIR:');readln(D[i].tmp);
Write('TANGGAL LAHIR:');readln(D[i].tgl);
Write('ALAMAT ASAL:');readln(D[i].alm);
Write('ALAMAT DI MALANG:');readln(D[i].mlg);
Writeln('');
END;
end;
Procedure nilai;
begin
wRITELN('===========================================');
wRITELN(' INPUTAN NILAI ');
wRITELN('===========================================');
for i:=1 to m do begin
Writeln('NIM:',D[i].nim);
write ('Nilai Uts : ');readln(h);
write ('Nilai Uas : ');readln(e);
write ('Nilai Tugas : ');readln(j);
write ('Nilai Quiz : ');readln(k);
writeLN ('Nilai Akhir : ',((h*25)+(e*35)+(j*20)+(k*20))/100:0:0,' ',
'ketik angka sembarang untuk langkah selanjutnya' );readLN(D[i].NA);
wRITELN('------------------------------------------');
end;
end;
Procedure inputandata;
begin
for i:=1 to m do begin
writeln;
writeln('=========================================');
writeln(' Hasil Inputan Mahasiswa');
writeln('=========================================');
writeln('Nim : ',D[i].nim);
writeln('Nama : ',D[i].nama);
writeln('Tempat Lahir : ',D[i].tmp);
writeln('Tanggal Lahir : ',D[i].tgl);
writeln('Alamat Asal : ',D[i].alm);
writeln('Alamat Malang : ',D[i].mlg);
writeln('=========================================');
end;
END;
Procedure inputannilai;
begin
for i:=1 to m do begin
writeln('=========================================');
writeln(' Hasil inputan nilai Mahasiswa ');
writeln('=========================================');
writeln('Nim : ',D[i].nim);
writeln('Nama : ',D[i].nama);
Writeln('NA : ',D[i].NA);
end;
end;
Procedure printout;
begin
for i:=1 to m do begin
writeln('=======================================');
Writeln(' Print Out Semua Data');
Writeln('=======================================');
Writeln('Nim : ',D[i].nim);
Writeln('Nama : ',D[i].nama);
writeln('Tempat Lahir : ',D[i].tmp);
writeln('Tanggal Lahir : ',D[i].tgl);
writeln('Alamat Asal : ',D[i].alm);
writeln('Alamat Malang : ',D[i].mlg);
Writeln('NA : ',D[i].NA);
writeln('=========================================');
end;
end;
begin
menu:
clrscr;
writeln ('=============================================');
writeln (' MENU INPUT DATA MAHASISWA ');
writeln ('=============================================');
writeln (' A. Data Mahasiswa');
writeln (' B. Nilai Mahasiswa');
writeln (' C. Tampilkan Semua Data Mahasiswa');
writeln (' D. Tampilkan Semua Nilai Mahasiswa');
writeln (' E. Printout Semua Data');
writeln (' F. Exit');
writeln ('=============================================');
writeln ('');
write ('Masukkan Pilihan Anda : ');readln(pilihan);
case pilihan of
'A':data;
'B':nilai;
'C':inputandata;
'D':inputannilai;
'E':printout;
'F': begin
halt(0);end;
end;
readln; GOTO menu;
end.
Kpan aku bisa kayak mbak nich yang pinter...
BalasHapusSori ya gann...sudah lama vakum dari blog ini...
BalasHapusmakasii banyak..^^