import java.awt.Container;
import java.util.*;

import javax.swing.*;


public class Project {
	public Project() {
		String username = Keyboard.readString();	
		String password = Keyboard.readString();
			if(password.equals("pwd") && username.equals("user")) {//checking against an array of username and passwords
			System.out.println("Correct");
		} else {
		System.out.println("Incorrect");
		}
		input(Keyboard.readString());
	}
	//need another array with full names and age to compare if we get a match
	//login
private List<String> db = Arrays.asList("jas78", "maw77", "jap55", "jae36");
	public void input(String in) {
		for (int i = 0; i < db.size(); i++) {//loop through array
			if (in.equals(db.get(i))) {//string checker
				System.out.println("Hi " + in + " your aber email is: " + in
						+ "@aber.ac.uk");// string constructor
			}
		}
	}

	private static void BuildWindow() {
		JFrame frame = new JFrame("Group A");

		frame.setBounds(20, 20, 100, 100);
		frame.setLayout(null);
		Container content = frame.getContentPane();
		frame.setSize(100, 100);
		frame.pack();
		JTextField txt_User = new JTextField();
		txt_User.setBounds(10, 10, 100, 17);

		frame.add(txt_User);
		frame.setVisible(true);

	}

}

@@ -40,17 +40,16 @@
 util.*;%0A
-%0A
 import j
@@ -63,17 +63,16 @@
 ing.*;%0A%0A
-%0A
 public c
@@ -90,347 +90,527 @@
 t %7B%0A
-%09public Project() %7B%0A%09%09String username = Keyboard.readString();%09%0A%09%09String password = Keyboard.readString();%0A%09%09%09if(password.equals(%22pwd%22) && username.equals(%22user%22)) %7B//checking against an array of username and passwords%0A%09%09%09System.out.println(%22Correct%22);%0A%09%09%7D else %7B%0A%09%09System.out.println(%22Incorrect%22);%0A%09%09%7D%0A%09%09input(Keyboard.readString());%0A%09%7D%0A%09
+    private String%5B%5D passwords = new String%5B%5D%7B%22apples%22,%22bananas%22,%22pinapples%22,%22pears%22%7D;%0A    private List%3CString%3E db = Arrays.asList(%22jas78%22, %22maw77%22, %22jap55%22, %22jae36%22);%0A%0A    %0A    public Project() %7B%0A        System.out.print(%22Username: %22);%0A        String username = Keyboard.readString();%0A        System.out.print(%22Password: %22);%0A        String password = Keyboard.readString();// reads the inputted password and attempts to match it%0A        //to any of the existing passwords%0A%0A        input(username, password);%0A    %7D%0A    
 //ne
@@ -683,17 +683,20 @@
 tch%0A
-%09
+    
 //login%0A
 priv
@@ -695,228 +695,146 @@
 gin%0A
-private List%3CString%3E db = Arrays.asList(%22jas78%22, %22maw77%22, %22jap55%22, %22jae36%22);%0A%09public void input(String in) %7B%0A%09%09for (int i = 0; i %3C db.size(); i++) %7B//loop through array%0A%09%09%09if (in.equals(db.get(i))) %7B//string checker%0A%09%09%09%09
+    public void input(String in, String pwd) %7B%0A        if(checkLogin(in, pwd)) %7B// checks the inputted password and user name%0A            
 Syst
@@ -894,14 +894,24 @@
  in%0A
-%09%09%09%09%09%09
+                
 + %22@
@@ -927,405 +927,732 @@
 k%22);
-// string constructor%0A%09%09%09%7D%0A%09%09%7D%0A%09%7D%0A%0A%09private static void BuildWindow() %7B%0A%09%09JFrame frame = new JFrame(%22Group A%22);%0A%0A%09%09frame.setBounds(20, 20, 100, 100);%0A%09%09frame.setLayout(null);%0A%09%09Container content = frame.getContentPane();%0A%09%09frame.setSize(100, 100);%0A%09%09frame.pack();%0A%09%09JTextField txt_User = new JTextField();%0A%09%09txt_User.setBounds(10, 10, 100, 17);%0A%0A%09%09frame.add(txt_User);%0A%09%09frame.setVisible(true);%0A%0A%09
+%0A        %7D else %7B%0A            System.out.print(%22Please re-enter your password%22);// ch%0A        %7D%0A    %7D%0A%0A    private boolean checkLogin(String in, String pwd) %7B%0A        for (int i = 0; i %3C db.size(); i++) %7B// provides a loop to go through both arrays, which should both be%0A            //the same length as they match eachother.%0A            if (in.equals(db.get(i)) && pwd.equals(passwords%5Bi%5D)) %7B// checks wheather the username at position i,%0A                //matches the users input, and does the same for the password, so each user has a unique password.%0A                // string constructor%0A                return true;%0A            %7D else %7B%0A                return false;%0A            %7D%0A        %7D%0A        return false;%0A%0A    
 %7D%0A%0A%7D

Update Project.java