I want the program to compare what the user puts in and then compare that string to something in an array and see if it is a match.
Here is code for things already put into array
private static void createExistingUserData(Scientist[] scientist){
scientist[0] = new Scientist("user1", "password1");
scientist[0].setDob("02/02/1995");
scientist[0].setSsn("612-45-7070");
scientist[0].setApplicantName("Peter Lee");
scientist[0].setInstituteName("George Washington University");
scientist[0].setDepartmentName("Information System Department");
scientist[0].setPositionRank(1);
scientist[0].setResearchTopic("Software Engineering");
scientist[0].setPastFunding(250000);
scientist[0].setNumOfPaper(30);
}
Here is code that i have right now for checking.
do{
ssn = JOptionPane.showInputDialog(null,"Please enter your social security number (xxx-xx-xxxx): ", "Lab 4",
JOptionPane.QUESTION_MESSAGE);
}while(!scientist[index].setSsn(ssn));
for (int i = 0; i < scientist.length; i++)
if (ssn.equals(scientist[i])){
System.out.print("This is in use");
}