Pages

Minggu, 03 Juli 2011

Soal No 4

uses crt;
var
pil : byte;
kode : array[1..10] of string;
nmadsen : array[1..10] of string;
pddkn : array[1..10] of string;
kahlian : array[1..10] of string;
npm : array[1..10] of string;
nama : array[1..10] of string;
jjg : array[1..10] of string;
jurusan : array[1..10] of string;
tahun : array[1..10] of string;
i,j : byte;
lg : char;

procedure Inputdosen;
begin
writeln('Bagian Input');
begin
repeat
inc(i);
clrscr;
Gotoxy(20,4); Writeln('MENGINPUT DATA DOSEN');
Gotoxy(20,5); Write('Masukkan Kode Dosen : '); Readln(kode[i]);
Gotoxy(20,6); Write('Nama Dosen : '); Readln(nmadsen[i]);
Gotoxy(20,7); Write('Pendidikan : '); Readln(pddkn[i]);
Gotoxy(20,8); Write('Keahlian : '); Readln(kahlian[i]);
Gotoxy(20,9); Write('Apakah Anda Ingin Menginput Lagi : '); Readln(Lg);
Until Lg In ['T', 't'];
End;
End;

procedure Inputmaha;
begin
writeln('Bagian Input');
begin
repeat
inc(i);
clrscr;
Gotoxy(20,4); Writeln('MENGINPUT DATA MAHASISWA');
Gotoxy(20,5); Write('Masukkan NPM : '); Readln(npm[j]);
Gotoxy(20,6); Write('Nama Mahasiswa : '); Readln(nama[j]);
Gotoxy(20,7); Write('Jenjang : '); Readln(jjg[j]);
Gotoxy(20,8); Write('Jurusan : '); Readln(jurusan[j]);
Gotoxy(20,9); Write('Tahun : '); Readln(tahun[j]);
Gotoxy(20,10); Write('Apakah Anda Ingin Menginput Lagi : '); Readln(Lg);
Until Lg In ['T', 't'];
End;
End;


Procedure Outputdosen;
Begin
Writeln('Bagian OutPut');
Clrscr;
Writeln(' INFORMASI DATA DOSEN ');
Writeln(' STMIK BUDIDARMA MEDAN ');
Writeln('------------------------------------------------------------------------');
Writeln(' No. Kode Nama Pendidikan Keahlian');
Writeln('------------------------------------------------------------------------');
For j :=1 to i do
inc(i);

Writeln(j:1,' ',kode[j]:7, nmadsen[j]:10, pddkn[j]:10, kahlian[j]:12);

Writeln('------------------------------------------------------------------------');
ReadLn;
end;


Procedure Outputmaha;
Begin
Writeln('Bagian OutPut');
Clrscr;
Writeln(' INFORMASI DATA MAHASISWA ');
Writeln(' STMIK BUDIDARMA MEDAN ');
Writeln('------------------------------------------------------------------------');
Writeln(' No. NPM Nama Jenjang Jurusan Tahun ');
Writeln('------------------------------------------------------------------------');
For j :=1 to i do
inc(i);

Writeln(j:1,' ',npm[j]:7, nama[j]:10, jjg[j]:5, jurusan[j]:8, tahun[j]:5);

Writeln('------------------------------------------------------------------------');
ReadLn;
end;


Begin
i:=0;
Clrscr;
Pil:=1;
Repeat
Writeln('Menu Utama');
Writeln('------------------------------------');
Writeln('[1]. Input Data Dosen');
Writeln('[1]. Input Data Mahasiswa');
Writeln('[3]. Output Data Dosen');
Writeln('[3]. Output Data Mahasiswa');
Writeln('[5]. Keluar Program');
Writeln('------------------------------------');
Write('Pilihan : ');
Readln(Pil);
Case Pil of
1 : Inputdosen;
2 : Inputmaha;
3 : Outputdosen;
4 : Outputmaha;

End;
Readln;
Until (Pil=5);
End.

output program:




Tidak ada komentar:

Poskan Komentar