Hi,
im new to java and i really need help with my assigment. I need a simple methode that will:
1- allow a member of a Internet cafe to log in to the workstation
2- log out of the workstation
3- a methode to add a new member to the cafe.
4- a methode to renew the membership
This is my code:
public class Member {
String ID;
double timeBalance;
double creditBalance;
String workstationID;
Integer totalTime;
Integer date;
Integer discount;
Integer loginTime;
Integer logoutTime;
String password;
//parameterized constructor
public Member(String ID, double timeBalance, double creditBalance, String
workstationID, Integer totalTime, Integer date, Integer discount,
Integer loginTime, Integer logoutTime, String password)
{
this.ID = ID;
this.timeBalanc e = timeBalance;
this.creditBala nce = creditBalance;
this.workstatio nID = workstationID;
this.totalTime = totalTime;
this.date = date;
this.discount = discount;
this.loginTime = loginTime;
this.logoutTime = logoutTime;
this.password = password;
}
public String getID()
{return ID;}
public String getpassword()
{return password;}
public double gettimeBalance( )
{return timeBalance;}
public double getcreditBalanc e()
{return creditBalance;}
public String getworkstationI D()
{return workstationID;}
public Integer gettotalTime()
{return totalTime;}
public Integer getdate()
{return date;}
public Integer getdiscount()
{return discount;}
public Integer getloginTime()
{return loginTime;}
public Integer getlogoutTime()
{return logoutTime;}
public void setID(String ID)
{this.ID= ID;}
public void setpassword(Str ing password)
{ this.password = password;}
public void settimeBalance( double timeBalance)
{this.timeBalan ce= timeBalance;}
public void setcreditBalanc e(double creditBalance)
{this.creditBal ance = creditBalance;}
public void setworkstationI D(String workstationID)
{this.workstati onID = workstationID;}
public void settotalTime(In teger totalTime)
{ this.totalTime = totalTime;}
public void setdate (Integer date)
{ this.date = date;}
public void setdiscount (Integer discount)
{this.discount = discount;}
public void setloginTime(In teger loginTime)
{this.loginTime = loginTime;}
public void setlogoutTime(I nteger logoutTime)
{ this.logoutTime = logoutTime;}
//This function is like a log in which the info for the member is stored in.
public void MemberInfo(Memb er m){
System.out.prin tln("Member ID is " + m.ID);
System.out.prin tln("Member time Balance is " + m.timeBalance);
System.out.prin tln("Member credit Balance is " + m.creditBalance );
System.out.prin tln("Member Workstation ID is " + m.workstationID );
System.out.prin tln("Total time spent by the Member is " + m.totalTime);
System.out.prin tln("Member log-in date is " + m.date);
System.out.prin t("Member discount is " + m.discount);
System.out.prin t("Member log-in time is " + m.loginTime);
System.out.prin t("Member log-out time is " + m.logoutTime);
System.out.prin t("Member password is " + m.password);
System.out.prin tln("");
}
im new to java and i really need help with my assigment. I need a simple methode that will:
1- allow a member of a Internet cafe to log in to the workstation
2- log out of the workstation
3- a methode to add a new member to the cafe.
4- a methode to renew the membership
This is my code:
public class Member {
String ID;
double timeBalance;
double creditBalance;
String workstationID;
Integer totalTime;
Integer date;
Integer discount;
Integer loginTime;
Integer logoutTime;
String password;
//parameterized constructor
public Member(String ID, double timeBalance, double creditBalance, String
workstationID, Integer totalTime, Integer date, Integer discount,
Integer loginTime, Integer logoutTime, String password)
{
this.ID = ID;
this.timeBalanc e = timeBalance;
this.creditBala nce = creditBalance;
this.workstatio nID = workstationID;
this.totalTime = totalTime;
this.date = date;
this.discount = discount;
this.loginTime = loginTime;
this.logoutTime = logoutTime;
this.password = password;
}
public String getID()
{return ID;}
public String getpassword()
{return password;}
public double gettimeBalance( )
{return timeBalance;}
public double getcreditBalanc e()
{return creditBalance;}
public String getworkstationI D()
{return workstationID;}
public Integer gettotalTime()
{return totalTime;}
public Integer getdate()
{return date;}
public Integer getdiscount()
{return discount;}
public Integer getloginTime()
{return loginTime;}
public Integer getlogoutTime()
{return logoutTime;}
public void setID(String ID)
{this.ID= ID;}
public void setpassword(Str ing password)
{ this.password = password;}
public void settimeBalance( double timeBalance)
{this.timeBalan ce= timeBalance;}
public void setcreditBalanc e(double creditBalance)
{this.creditBal ance = creditBalance;}
public void setworkstationI D(String workstationID)
{this.workstati onID = workstationID;}
public void settotalTime(In teger totalTime)
{ this.totalTime = totalTime;}
public void setdate (Integer date)
{ this.date = date;}
public void setdiscount (Integer discount)
{this.discount = discount;}
public void setloginTime(In teger loginTime)
{this.loginTime = loginTime;}
public void setlogoutTime(I nteger logoutTime)
{ this.logoutTime = logoutTime;}
//This function is like a log in which the info for the member is stored in.
public void MemberInfo(Memb er m){
System.out.prin tln("Member ID is " + m.ID);
System.out.prin tln("Member time Balance is " + m.timeBalance);
System.out.prin tln("Member credit Balance is " + m.creditBalance );
System.out.prin tln("Member Workstation ID is " + m.workstationID );
System.out.prin tln("Total time spent by the Member is " + m.totalTime);
System.out.prin tln("Member log-in date is " + m.date);
System.out.prin t("Member discount is " + m.discount);
System.out.prin t("Member log-in time is " + m.loginTime);
System.out.prin t("Member log-out time is " + m.logoutTime);
System.out.prin t("Member password is " + m.password);
System.out.prin tln("");
}
Comment