You can not select more than 25 topics
Topics must start with a chinese character,a letter or number, can include dashes ('-') and can be up to 35 characters long.
|
- package homework.pkg5;
-
- import java.util.Scanner;
-
-
- public class LogIn{
-
-
- public static void main(String[] args) {
-
- //declare variables
- String username, password;
- int n = 0;
-
- Scanner scanner = new Scanner (System.in);
-
- while (n<3) {
-
- //prompt user for their username
- System.out.print("Enter your username: ");
- username = scanner.nextLine();
-
- //prompt user for their password
- System.out.print("Enter your password: ");
- password = scanner.nextLine();
-
-
- if ("Justinfromcharleston@gmail.com".equals(username) && "secret17".equals(password))
- { System.out.println("Welcome " + username + "!!!");
- break;
- }
- else if(!"secret17".equals(password) || !"Justinfromcharleston@gmail.com".equals(username)) {
- System.out.println("Incorrect login. Please try again.");
-
-
- }
-
-
- }
- }
- }
|