program percabangan sederhana dalam bahasa pascal
program nilai;
uses crt;var
a,i:byte;
NIM,NAMA,kelas,o:string;
begin
clrscr;
textcolor(lightGREEN);
gotoxy(33,11);
writeln('....LOADING....');
o:='@';
gotoxy(30,12);
for i:=1 to 20 do
begin
write(o);
delay(80);
end;
gotoxy(30,14);
writeln('program siap di pakai');
gotoxy(33,16);
writeln('TEKAN ENTER');
readln;
clrscr;
textcolor(yellow);
gotoxy(20,2); writeln('================================================');
gotoxy(20,3); writeln( '+++++++++++++ DAFTAR NILAI ++++++++++++++');
gotoxy(20,4); writeln('================================================');
textcolor(lightgreen);
gotoxy(20,6); write('NIM : '); readln (NIM);
gotoxy(20,7); write('NAMA LENGKAP ANDA : '); readln (NAMA);
gotoxy(20,8); write('KELAS ANDA : '); readln (kelas);
gotoxy(20,9); write('INPUT NILAI ANDA[1-100] : '); readln (a);
textcolor(yellow);
gotoxy(20,12);
if (a>=90) and (a<=100) then
writeln('SELAMAT NILAI ANDA A')
else if (a>=70) and (a<=89) then
writeln('NILAI ANDA B')
else if (a>=60) and (a<=69) then
writeln('NILAI ANDA C')
else if (a>=45) and (a<=59) then
writeln ('NILAI ANDA D')
else if (a>=0) and (a<=44) then
writeln ('NILAI ANDA E')
else
begin
textcolor(lightRED);
write ('NILAI YANG ANDA INPUTKAN TIDAK VALID COBA PERIKSA KEMBALI');
end;
readln;
end.
0 komentar: