Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- private static void login(ArrayList<Shopper> shopper) {
- // TODO Auto-generated method stub
- String username, password;
- Scanner keyboard = new Scanner(System.in);
- System.out.print("Username: ");
- username = keyboard.nextLine();
- System.out.print("Password: ");
- password = keyboard.nextLine();
- for(int i = 0; i<shopper.size(); i++)
- {
- if((shopper.get(i).getusername().equals(username))
- && (shopper.get(i).getpword().equals(password)))
- {
- System.out.println("Welcome to Daintree " +shopper.get(i).getName()+
- ". You are log in as " +shopper.get(i).getMemberType());
- }
- else
- {
- System.out.println("Invalid username and password.Please try again!");
- }
- }
- }
Add Comment
Please, Sign In to add comment