package javaapplication38;
import java.util.Scanner;
public class JavaApplication38 {
public static void main(String[] args)
{
int attemp=3;
String userid="salman",password="xyz123";
Scanner sc=new Scanner(System.in);
String uid,pwd;
System.out.println("Enter you email id to use this software...........");
uid=sc.next();
if (uid.equalsIgnoreCase(userid)==true)
{
while(attemp>=0)
{
System.out.println("Enter your password :");
pwd=sc.next();
if (pwd.equals(password))
{
System.out.println("You are successfully login.......");
break;
}
else
{
System.out.println("Invalid Password.....\nyou have "+attemp+" left ");
attemp--;
}
}
}
else
{
System.out.println("Invalid id.....\nyou have "+attemp+" left ");
}
}
}
No comments:
Post a Comment