This is just a simple password program...
Password program
Program Password_Program;
{used moduls}
Uses Crt;
{Declare variables}
Var Password,User:String[11];
Count,i:Byte;
Begin {main}
Password:='123-456-78';
Count:=3;
ClrScr; {ClearScreen}
For i:=3 DownTo 1 Do
Begin
Write(i:2,'.Give Me The Password: ');
ReadLn(User);{catch the user password}
If (User <> Password) Then {analize it}
Begin
WriteLn('Error!');
Count:=Count-1;
If (Count=0)Then
Begin {if count reaches 0 then exit}
WriteLn('Access Deined!');
ReadKey;
Halt;
End;
Continue; {if not good,ask again}
End
Else Begin
WriteLn('Ok.');
Break; {if good breaking loop}
End;
End;
WriteLn('Have a nice day...');
ReadLn;
End. {main}
{
-=Note By FlamingClaw=-
This is just a simple password program...
-=Created By FlamingClaw=-
2009.03.16.
}
Be a part of the DaniWeb community
We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.