Can someone please solve the 13th question in bluej please in ninth grade level
Attachments:
Answers
Answered by
19
Answer:
public class Main
{
public static void main(String[] args){
String password = "Test";
String inputPass;
Scanner input = new Scanner(System.in);
System.out.println("Enter Your Password:");
inputPass = input.nextLine();
if (inputPass.equals(password))
{
System.out.println("Welcome User!");
}
else
{
for (int i = 0; i < 2; i++)
{
System.out.println("Enter Your Password:");
inputPass = input.nextLine();
if (inputPass.equals(password))
{
System.out.println("Correct username and password");
}
}
System.out.println("Try again");
}
}
}
Similar questions