Source Code
Program Biodata_Mahasiswa;
uses
crt;
Type
Rec = Record
Nama : String;
NIM : String;
Tl : string;
Umur : Longint;
end;
var
Data : array[1..50] of Rec;
n,i : integer;
pilih : string;
Procedure Input;
Begin
clrscr;
n:=0;
repeat
clrscr;
inc(n);
writeln('|===================================|');
writeln('| BIODATA MAHASISWA |');
writeln('|===================================|');
writeln('| Data ke-',n,' |');
writeln('|===================================|');
with
Data[n] do
begin
writeln('|===================================|');
writeln('| Nama : |');
writeln('| NIM : |');
writeln('| Tanggal Lahir : |');
writeln('| Umur : Tahun |');
writeln('|===================================|');
gotoxy(19,7);readln(Nama);
gotoxy(19,8);readln(NIM);
gotoxy(19,9);readln(Tl);
gotoxy(19,10);readln(Umur);
end;
writeln;
write('Input Data Lagi? [Y/N] : ');readln(Pilih);
Until
((Pilih='n') or (Pilih='N'));
end;
Procedure Output;
Begin
clrscr;
writeln('|==================================================================|');
writeln('| BIODATA
MAHASISWA |');
writeln('|================================================|=================|');
writeln('| Nama |
NIM | Umur
| Tanggal Lahir |');
writeln('|=======================|===========|============|=================|');
for i:=1
to n do
begin
writeln('|
| | | |');
with
Data[i] do
begin
gotoxy(3,5+i);writeln(Nama);
gotoxy(27,5+i);writeln(NIM);
gotoxy(43,5+i);writeln(Umur);
gotoxy(52,5+i);writeln(tl);
end;
end;
writeln('|==================================================================|');
readkey;
end;
Begin
repeat
clrscr;
writeln('|======================|');
writeln('| Menu Utama |');
writeln('| 1. Masukkan Data |');
writeln('| 2. Lihat Data |');
writeln('| 3. Keluar |');
writeln('|======================|');
writeln('|
|');
writeln('| Masukkan Pilihan :
|');
writeln('|======================|');
gotoxy(22,8);readln(Pilih);
case
Pilih of
'1' :
Input;
'2' :
Output;
'3' :
Exit;
else
write('Input salah, input ulang!');
end;
Until (Pilih)='3';
end.
Tampilan ketika program dijalankan:
Tidak ada komentar:
Posting Komentar