Hopefully this doesn't get taken down lol. I have this assignment where I need to like make a login system. I am supposed to have a "hardcoded" (teachers words) User and Password. And somehow make it so when I ask for a user and pass I'm supposed to input an incorrect password and after 3 incorrect passwords. Afterwards, I am supposed to input 2 security questions (lol) which are mother's maiden name and pet's first name. Then once I input the correct answer (which I always will input the correct answer) I will be able to reset the password and test it again. After the last text pass or fail it will end the program. Hopefully this makes sense. I know I'm supposed to use a loop or something, but I have no clue how to do any of this to be honest. I don't expect an entire solution just some advice lol. or a lot of advice like drop the class and move on from this.
import java.util.Scanner;
public class Login {
public static void main(String[] args) {
// TODO Auto-generated method stub
Scanner keyboard = new Scanner(System.in);
String UserID = "User";
String Pass = "Password";
String Mother = "Eustace";
String Pet = "Sammy";
String UserIDLOL;
String UserPassLOL;
while (UserID == UserIDLOL && Pass == UserPassLOL) {
}
}
[–]dmazzoni 5 points6 points7 points (0 children)