Percabangan pada Pascal

uses crt;
var
       uts:integer;
       Nama:string;
       Pil:char;
begin
            clrscr;
            writeln(‘================***===============‘);
            writeln(‘Menu :’);
            writeln(‘1.Identitas’);
            writeln(‘2.Nilai UTS’);           
            writeln(‘==================================‘);
            write(‘Masukan pilihan’);
            readln(pil);
writeln(‘==================================‘);
            case pil of
            ‘1’ : begin
   write(‘Masukan Nama = ‘);
readln(Nama);
write(‘Masukan npm = ‘);
readln(Npm);
writeln(‘==================================‘);
if Npm = ‘51409121’ then
writeln(‘Nilai UTS = 100’)
else
writeln(‘salah input’);
end;
            ‘2’ : begin
 write(‘Masukan Nilai UTS = ‘);
 readln(uts);
 writeln(‘==================================‘);
 if uts > 65 then
 writeln(‘Kategori = Lulus’)
 else
 writeln(‘Kategori = Gagal’);
 end;
            end;
readln;
end.

0 komentar:

Posting Komentar

Twitter Delicious Facebook Digg Stumbleupon Favorites More

 
This Theme Modified by Kapten Andre based on Structure Theme from MIT-style License by Jason J. Jaeger