Module Lab Assessment 3: Hash Tables and Binary Search Trees

MemberAccountNew.java

public class MemberAccountNew {
// Write your code here	

		
}

MemberAccountOld.java

import java.util.LinkedList;

public class MemberAccountOld {
	
	private String loginEmail;
	private String password;
	private long memberID;
	private LinkedList<Long> watchedList; //will contained id of watched videos
	
	public MemberAccountOld(String loginEmail, String password, long memberID) {
		super();
		this.loginEmail = loginEmail;
		this.password = password;
		this.memberID = memberID;
		this.watchedList = new LinkedList<>();
	}

	public String getLoginEmail() {
		return loginEmail;
	}
	
	public void setLoginEmail(String loginEmail) {
		this.loginEmail = loginEmail;
	}
	
	public String getPassword() {
		return password;
	}
	
	public void setPassword(String password) {
		this.password = password;
	}
	
	public long getMemberID() {
		return memberID;
	}
		
	public LinkedList<Long> getWatchedList() {
		return watchedList;
	}
	
	public void addWatchedVideo(Long watchedVideoID) {
		watchedList.add(watchedVideoID);
	}
		
}

MemberDataNew.java

public class MemberDataNew {
// Write your code here	

}

MemberDataOld.java

import java.util.ArrayList;

public class MemberDataOld {
	
	private ArrayList<MemberAccountOld> accountsList;
	private ArrayList<String> emailList;
	
	

	public MemberDataOld() {
		super();
		accountsList = new ArrayList();
		emailList = new ArrayList();
	}
		
	public void addAccount(MemberAccountOld account) {
		this.accountsList.add(account);
		this.emailList.add(account.getLoginEmail());
	}
	
	public MemberAccountOld getAccount(String email) {
		int index = emailList.indexOf(email);
		return accountsList.get(index);
	}

}

SimilarMember.java

public class SimilarMember {

	/**This method 
	 * 
	 * @param accounts 
	 * @param loginEmail 
	 * 
	 * @return 
	 */
	public static MemberAccountNew getSimilarMember(MemberDataNew accounts, String loginEmail) {
		
		return null;
	}

	/**This method 
	 * 
	 * @param accounts 
	 * @param account 
	 * 
	 * @return 
	 */
	public static MemberAccountNew getSimilarMember(MemberDataNew accounts, MemberAccountNew account) {
				
		return null;
	}

	/**This method 
	 * 
	 * @param 
	 * @param 
	 * 
	 * @return 
	 */
	private static int findSimilarityIndex(MemberAccountNew account1, MemberAccountNew account2) {
		
		return -1;
	}

	public static void main(String[] args) {
        /*   
        * This main method is a stub.
        */
        
        
    }
}

Last updated