Sabtu, 17 Januari 2009

Membuat Program Password dengan Pascal

program Password;
uses wincrt;
var
x,y:string;
i,n:integer;
begin
y:='POLITEL';
i:=0;
repeat
clrscr;
i:=i+1;
writeln('===============================================');
writeln(' Selamat Datang ');
writeln('===============================================');
write(' Masukkan Password = ');readln(x);
for n:=0 to Length (x) do
x[n]:=UpCase(x[n]);
if (x<>y) and (i<3 br="br" then="then"> begin
writeln('-----------------------------------------------');
writeln(' Password Yang Anda Masukkan Salah,Coba Lagi! ');
writeln(' Tekan ENTER! ');
writeln('-----------------------------------------------');
readln;
end
else
if(x<>y) and (i=3) then
begin
writeln('-----------------------------------------------');
writeln(' Anda gagal 3 kali,Anda tidak bisa Masuk! ');
writeln('-----------------------------------------------');
end
else
begin
writeln('===============================================');
writeln(' Selamat Anda Berhasil Masuk ');
writeln('===============================================');
end;
until (x=y) or (i=3);
readln;
end.

Tidak ada komentar:

Posting Komentar

Kirim Komentar Anda
(Send Your Comment)