Thanks so much for ur help wolf!
i have a few more questions.. sorry about that, cause project's due in 2 days. really stress out!!
I need to differentiate between student login & Tutor login. When student logins the correct password & ID, the system will save their ID,date and time into a data structure and display the current date and time.
When the tutor login,he will see the list of students cloaked in.
This is my datastorage:
import java.util.Vector;
public class DataStorage
{
private Vector aRecVec;
DataStorage()
{
aRecVec = new Vector(3);
}
public void StoreProjectRec(ProjectRec aRec)
{
aRecVec.addElement(aRec);
}
public ProjectRec getProjectRec(String name)
{
ProjectRec aRec = null;
for (int i=0; i<aRecVec.size(); i++)
{
aRec = (ProjectRec)aRecVec.get(i);
if (aRec.getUser().equals(name))
break;
aRec = null;
}
return aRec;
}
}
ProjectRec
public class ProjectRec
{
private String user;
private String userType;
private String date;
public ProjectRec(String nm, String ut, String d)
{
user = nm;
userType = ut;
date = d;
}
public String getUser()
{
return user;
}
public void setUser(String u)
{
user = u;
}
public String getUserType()
{
return userType;
}
public void setUserType(String ut)
{
userType = ut;
}
public String getDate()
{
return date;
}
public void setDate(String d)
{
date = d;
}
}
Controller:
public class ProjectController {
private DataStorage ds;
private ProjectRec p;
public ProjectController()
{
ds = new DataStorage();
}
public void createProjectRec(String nm, String pwd, String ut)
{
ProjectRec temRec = new ProjectRec(nm, pwd, ut);
ds.StoreProjectRec(temRec);
}
public String [] getProjectInfo(String nm)
{
String [] info = new String[2];
p = ds.getProjectRec(nm);
info[0] = p.getUser();
info[1] = p.getUserType();
return info;
}
}
please help :o