Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- package com.company;
- import java.util.Scanner;
- public class SeasonFinder {
- public static void main(String[] args){
- Scanner input = new Scanner(System.in);
- int x = 0;
- System.out.print("Input your Username:");
- String usr = input.nextLine();
- System.out.print("Input your Password:");
- String pwd = input.nextLine();
- //case statements can't perform logic.
- if(usr.equals("admin"))
- {
- x = x+10;
- }
- if(pwd.equals("open"))
- {
- x = x+1;
- }
- switch(x)
- {
- case(11):
- System.out.print("Welcome.");
- break;
- case(10):
- System.out.print("Wrong Password");
- break;
- case(1):
- System.out.print("Wrong User ID");
- default:
- System.out.print("Sorry, wrong User ID and Password");
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement