Laman

Categories

Selasa, 08 Mei 2012

Program Input Data Mahasiswa

{PROGRAM  LAPORAN Mahasiswa}
{Created By Yongki}
uses crt;
var
   NAMA   : Array[1..20] of String[20];
   NPM    : Array[1..20] of String[8];
   FAK    : Array[1..20] of String[2];
   ANGK   : Array[1..20] of String[2];
   BPP    : Array[1..20] of LONGINT;
   I,N    : Byte;
   Total  : LONGINT;
   lagi   : char;
BEGIN
                ClrScr;
        lagi := 'Y';
while lagi ='Y' do
        Begin
        I:=I+1;
        WRITELN('Masukkan data ke : ',I);
        WRITE('Nama             : ');readln(nama[I]);
        WRITE('NPM              : ');readln(npm[I]);
        FAK[I]  := COPY(NPM[I],1,1);
        ANGK[I] := COPY(NPM[I],4,2);
        write('Masukkan Data Lagi?? ');
        readln(lagi);
        IF ANGK[I]='11' THEN BPP[I] := 2000000
           ELSE IF ANGK[I] = '10' THEN BPP[I] := 1750000
                ELSE IF ANGK[I] = '09' THEN BPP[I] := 1600000
                     ELSE BPP[I] := 1500000;
        TOTAL := TOTAL + BPP[I];
        end;

                CLRSCR;
        GotoXY(10,2); WRITE('Daftar Mahasiswa');
        GotoXY(10,3); WRITE('--------------------------------------------------------');
        GotoXY(10,4); WRITE('No    NPM','NAMA':8,'FAK':10,'ANGK':11,'BPP':12);
        GotoXY(10,5); WRITE('--------------------------------------------------------');

                For N := 1 to I  do
        Begin
        GotoXY(10,5+N); WRITEln(N:1,'   ', NPM[N]:5, NAMA[N]:8, FAK[N]:9, ANGK[N]:11, BPP[N]:12);
        end;
        GotoXY(10,11); WRITEln('--------------------------------------------------------');
        WRITE('TOTAL BPP = ', TOTAL);
        delay(1000);
END.


berikut ini adalah output dari program :

0 komentar:

Posting Komentar

^^