Perulangan dengan Repeat Until


uses wincrt;

{ program KRS sederhana dalam dua versi bahasa}

var total,IP:real;

sks,x:integer;

mk:string;

begin

writeln (‘ SELAMAT DATANG DALAM PENGISIAN KRS ‘);

writeln (‘ 1. dalam versi bahasa jawa’);

writeln (‘ 2. dalam versi bahasa indonesia’);

write (‘pilih versi = ‘);read (x);

if (x= 1) then

begin

write (‘lebokno nilai IP semestermu = ‘); readln (IP);

total:= 0;

if (IP < =1.2)then begin write ('kowe nduwe jatah sks = 12'); repeat begin write (' lebokno mata kuliah seng arep mbok jipuk = ');readln (mk); write (' lebokno sks mata kuliah seng mbok jipuk = '); readln (sks); total:= total+sks end; until (total =12); write (' jatah sks mu wis entek'); end; if ( IP <= 2) then begin writeln ('kowe nduwe jatah sks = 21'); repeat begin write (' lebokno mata kuliah seng arep mbok jipuk = ');readln (mk); write ('lebokno sks mata kuliah seng mbok jipuk = ');readln (sks); total:= total + sks end; until ( total= 21); write ('jatah sksmu wis entek'); end; if ( IP >= 3 ) then

begin

writeln (‘ kowe nduwe jatah sks = 24’);

repeat

begin

write (‘lebokno mata kuliah seng arep mbok jipuk = ‘);readln (mk);

write (‘lebokno sks mata kuliah seng mbok jipuk = ‘);readln (sks);

total:= total + sks

end;

until (total = 24);

write (‘jatah sksmu wis entek’);

end;

if ( IP < 3) then begin writeln ('kowe nduwe jatah sks = 22'); repeat begin write (' lebokno mata kuliah seng arep mbok jipuk = ');readln (mk); write (' lebokno sks mata kuliah seng mbok jipuk = ');readln (sks); total:=total + sks end; until (total = 22); write ('jatah sksmu wos entek'); end; end; if (x = 2) then begin write ('masukan nilai IP semester = '); readln (IP); total:= 0; if ( IP <= 2) then begin writeln ('anda mempunyai jatah sks = 21'); repeat begin write (' input mata kuliah yang akan anda ambil = ');readln (mk); write ('input sks mata kuliah yang anda ambil = ');readln (sks); total:= total + sks end; until ( total= 21); write ('jatah sks anda sudah habis'); end; if ( IP >= 3 ) then

begin

writeln (‘ anda mempunyai jatah sks = 24’);

repeat

begin

write (‘input mata kuliah yang akan anda ambil= ‘);readln (mk);

write (‘input sks mata kuliah yang anda ambil= ‘);readln (sks);

total:= total + sks

end;

until (total = 24);

write (‘jatah sks anda sudah habis’);

end;

if ( IP < 3) then begin writeln ('anda mempunyai jatah sks = 22'); repeat begin write (' input mata kuliah yang akan anda ambil = ');readln (mk); write (' input sks mata kuliah yang anda ambil = ');readln (sks); total:=total + sks end; until (total = 22); write ('jatah sks anda sudah habis'); end; end; end.


One response to “Perulangan dengan Repeat Until”

Leave a Reply