Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import java.util.Scanner;
- public class Main{
- public static void main(String[] args) {
- Scanner reader = new Scanner(System.in);
- System.out.print("Type your username: ");
- String username = reader.nextLine();
- System.out.print("Type your password: ");
- String password = reader.nextLine();
- if (username.equals("alex")) {
- if(password.equals("mightyducks")){
- System.out.println("You are now logged into the system!");
- }
- } else if (username.equals("emily")) {
- if(password.equals("cat")){
- 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