Data mahasiswa repeat until

arif zainurrohman

program rataasli;
uses wincrt;
type
mhs = record
nim : longint;
Nama : string[40];
nilai : array[1..144] of real;
end;
var
univs : array[1..10] of mhs;
i,j,n : longint;
juml : longint;
total,rata : real;
lagi:char;
Begin
repeat
clrscr;
write('Jumlah data yang dientri : ');readln(juml);
{entri data}
Writeln('Pengisiam data mahasiswa');
for i:=1 to juml do
begin
with univs[i] do
begin
write('Isikan NIM : ');readln(NIM);
write('Isikan nama : ');readln(nama);
end;
end;
{entri data nilai}
Writeln('Pengisiam data nilai mahasiswa');
for i:=1 to juml do
begin
writeln('Entri data nilai mahasiswa ke-',i);
with univs[i] do
begin
write('banyak nilai : ');readln(n);
for j:=1 to n do
begin
write('Isikan nilai-',j,' : ');readln(nilai[j]);
end;
end;
end;
{Report data}
for i:=1 to juml do
begin
total:=0;
with univs[i] do
begin
writeln('NIM : ',NIM);
writeln('nama : ',nama);
for j:=1 to n do write(' nilai- ',j);
writeln;
for j:=1 to n do
begin
write(nilai[j]:10:2);
total:=total+nilai[j];
rata:=total/n;
end;
end;
writeln;
writeln('Nilai totalnya adalah ',total:10:2);
writeln('rata rata : ',rata:10:2);
end;
readkey;
writeln(' anda ingn ulangi ? (y/t)');readln(lagi);
if lagi = 't' then
clrscr;
gotoxy(30,10);
writeln (' TERIMA KASIH ')
until (lagi = 't');
end.


Kota Pempek , 23 Maret 2012




akhukum fillah arif zainurrohman

0 komentar:

Posting Komentar