Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import java.util.Scanner;
- public class Usernames {
- public static void main(String[] args) {
- Scanner reader = new Scanner(System.in);
- System.out.println("Type your username: ");
- String username = reader.nextLine();
- System.out.println("Type your password: ");
- String password = reader.nextLine();
- String user = "alex";
- String userTwo = "emily";
- String pass = "mightyducks";
- String passTwo = "cat";
- if (username.equals(user) && (password.equals(pass))) {
- System.out.println("You are now logged into the system!");
- }else if(username.equals(userTwo) && (password.equals(passTwo))) {
- System.out.println("You are now logged into the system!");
- }else{
- System.out.println("Your username or password was invalid!");
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement