Jumat, 13 Maret 2015

BIODATA MAHASISWA

Contoh program biodata mahasiwa
Source Code:

uses crt;
type data_record = record
   NIM   : string;
   Nama  : string;
   Umur : real;
  end;
var data         : array [1..10] of data_record;
    i,n          : integer;
    Jawab        : string;
    NilaI        : Real;

Procedure Input;
 Begin
  clrscr;
  i:=1;
  repeat
   writeln(' ');
   writeln(' ');
   write('          Nama   : ');readln(data[i].nama);
   writeln(' ');
   write('          NIM    : ');readln(data[i].NIM);
   writeln(' ');
   write('          Umur   : ');readln(data[i].Umur);
  i:=i+1;
   writeln(' ');
   writeln(' ');
   write('Input Lagi ? [Y/N] ');readln(Jawab);
  until (Jawab='N') or (Jawab='n');
 End;


Procedure Table;
 begin

 end;

Procedure Output;
 Begin
 clrscr;
  writeln('                   ##########################');
  writeln('                   <<<Data Mahasiswa Ilkom>>>');
  writeln('                   ##########################');
  writeln('           ____________________________________________  ');
  writeln('          | No |     Nama    |    NIM     |    Umur    | ');
  writeln('          |____|_____________|____________|____________| ');
  writeln('          |    |             |            |            |');
  writeln('          |____|_____________|____________|____________|');
  for n:=1 to i-1 do
   begin
    gotoxy(11,6+n);Table;
    gotoxy(13,6+n);write(n);
    gotoxy(18,6+n);write(data[n].nama);
    gotoxy(31,6+n);write(data[n].NIM);
    gotoxy(48,6+n);write(data[n].Umur:0:0);
   end;
   writeln;
   writeln;
 End;


Begin
 repeat
  Input;
  Output;
 writeln(' ');
 writeln(' ');
 write('Mau Ulang ? [Y/N] : ');readln(Jawab);
 until (Jawab='N') or (Jawab='n');
  readln;
End.

Output:

Tidak ada komentar:

Posting Komentar