program data_dosen_mahasiswa;
uses crt;
type
dosen =record
kode :string;
nama :string[15];
pendidikan :string[15];
keahlian :string[15];
end;
mahasiswa =record
npm :string[7];
nama :string[15];
jenjang :string[15];
jurusan :string[15];
tahun :integer;
end;
var
rdos :array[1..20] of dosen;
rmah :array[1..20] of mahasiswa;
i,j :byte;
lg,pil :char;
procedure inputdosen;
procedure formdosen;
begin
clrscr;
gotoxy(5,3);write(‘input data dosen’);
gotoxy(5,4);write(‘———————————’);
gotoxy(5,5);write(‘kode dosen :’);
gotoxy(5,6);write(‘nama :’);
gotoxy(5,7);write(‘pendidikan :’);
gotoxy(5,8);write(‘keahlian :’);
gotoxy(5,9);write(‘———————————’);
gotoxy(5,10);write(‘inputkan data lagi[y/t]:’);
end;
begin
repeat
formdosen;
with rdos[i] do
begin
gotoxy(22,5);readln(kode);
gotoxy(22,6);readln(nama);
gotoxy(22,7);readln(pendidikan);
gotoxy(22,8);readln(keahlian);
gotoxy(29,10);readln(lg);
end;
inc(i);
until upcase(lg)=’t’;
end;
procedure outputdosen;
procedure tabeldosen;
begin
clrscr;
gotoxy(3,4);write(‘informasi data dosen’);
gotoxy(3,5);write(‘——————————-’);
gotoxy(3,6);write(‘no kode nama pendidikan keahlian’);
gotoxy(3,7);write(‘————————————————————’);
end;
begin
tabeldosen;
for j:=1 to i do
begin
with rdos[j] do
begin
gotoxy(5,7+i);write(j:2,’ ‘,kode:8,’ ‘,nama);
gotoxy(30,7+i);write(pendidikan);
gotoxy(43,7+i);write(keahlian);
end;
end;
gotoxy(3,9+i);write(‘———————————————————–’);
repeat until keypressed;
end;
procedure inputmahasiswa;
procedure formmahasiswa;
begin
clrscr;
gotoxy(5,3);write(‘input data mahasiswa’);
gotoxy(5,4);write(‘———————————’);
gotoxy(5,5);write(‘npm :’);
gotoxy(5,6);write(‘nama :’);
gotoxy(5,7);write(‘jenjang :’);
gotoxy(5,8);write(‘jurusan :’);
gotoxy(5,9);write(‘tahun :’);
gotoxy(5,10);write(‘———————————’);
gotoxy(5,11);write(‘inputkan data lagi[y/t]):’);
end;
begin
repeat
formmahasiswa;
with rmah[i] do
begin
gotoxy(22,5);readln(npm);
gotoxy(22,6);readln(nama);
gotoxy(22,7);readln(jenjang);
gotoxy(22,8);readln(jurusan);
gotoxy(22,9);readln(tahun);
gotoxy(29,10);readln(lg);
end;
inc(i);
until upcase(lg)=’t’;
end;
procedure outputmahasiswa;
procedure tabelmahasiswa;
begin
clrscr;
gotoxy(10,4);write(‘input data mahasiswa’);
gotoxy(3,5);write(‘——————————————–’);
gotoxy(3,6);write(‘no npm nama jenjang jurusan tahun’);
gotoxy(3,7);write(‘———————————————————————’);
end;
begin
tabelmahasiswa;
for j:=1 to i do
begin
with rmah[j] do
begin
gotoxy(5,7+j);write(j:2,’ ‘,npm:8,’ ‘,nama);
gotoxy(43,7+i);write(jenjang);
gotoxy(51,7+i);write(jurusan);
gotoxy(58,7+i);write(tahun);
end;
end;
gotoxy(3,9+j);write(‘———————————————————————-’);
repeat until keypressed;
end;
procedure menu;
begin
clrscr;
gotoxy(20,2);write(‘menu utama’);
gotoxy(10,3);write(‘——————–’);
gotoxy(10,4);write(‘[1]. input data dosen’);
gotoxy(10,5);write(‘[2]. input data mahasiswa’);
gotoxy(10,6);write(‘[3]. output data dosen’);
gotoxy(10,7);write(‘[4]. output data mahasiswa’);
gotoxy(10,8);write(‘[5]. keluar program’);
gotoxy(10,9);write(‘—————————–’);
gotoxy(10,10);write(‘pilihan :’);
end;
begin
i:=1;
pil:=’1′;
while pil<>’5′ do
begin
menu;
pil:=readkey;
case pil of
’1′:inputdosen;
’2′:inputmahasiswa;
’3′:outputdosen;
’4′:outputmahasiswa;
end;
end;
end.
3.585242
98.675598