if it helps, here is my full code on one of my classes
public class BankAccount { private String name; private String account; private double checkingAccount; private double savingsInterestRate; private double savingsAccount; private int savingsDays; private double totalEarnedInterest;
public BankAccount()
{
}//end BankAccount()
public BankAccount(String name, String account)
{
setName(name);
setAccount(account);
}//end BankAccount(String, String)
public BankAccount(String name, String account, double amount)
{
setName(name);
setAccount(account);
setChecking(amount);
}//end BankAccount(String, String, double)
public void setName(String Name)
{
this.name = Name;
}//end setName(String)
public void setAccount(String acc)
{
this.account = acc;
}//end setAccount
public void setChecking(double amount)
{
if(amount >=0.00)
{
this.checkingAccount = amount;
}
}//end setChecking(double)
public void setSavings(double amount)
{
if(amount >=0.0)
{
this.savingsAccount = amount;
}
}//end setSavings(double)
public void setDays(int num)
{
if(num >= 0)
{
savingsDays= num;
}
}//end setDays
public void setSavingsInterestRate(double rate)
{
if(rate >= 0.0)
{
savingsInterestRate= rate;
}
}//end setSavingsInterestRate(double)
public String getName()
{
String strFullName;
strFullName = this.name;
return strFullName;
}
//end getName()
public String getAccount()
{
String strAccountNum;
strAccountNum= this.account;
return strAccountNum;
}//end getAccount()
public double getChecking()
{
double dAmount;
dAmount = this.checkingAccount;
return dAmount;
}//end getChecking
public double getSavings()
{
double dSavAm;
dSavAm = this.savingsAccount;
return dSavAm;
}//end getSavings
public double getSavingsIntrest()
{
double dSavIn;
dSavIn = this.savingsInterestRate;
return dSavIn;
}//end getSavingsIntrest
public double getTotalEarnedInterest()
{
double dTotal;
dTotal= this.savingsInterestRate * this.savingsAccount;
return dTotal;
}//end getTotalEarnedInterest
public int getDays()
{
int iResult;
iResult = this.savingsDays;
return iResult;
}//end getDays
public int addDays(int iNumDays)
{
int iDays = 0;
if(iNumDays > 0)
{
this.savingsDays =iNumDays + this.savingsDays;
iDays = this.savingsDays;
}
return iDays;
}//end addDays
public double addInterest()
{
int i;
double dNewInterest = 0.0;
int iNewDays = 0;
for(i=30; i<iNewDays; i++)
{
dNewInterest =(this.savingsInterestRate * this.savingsAccount)*this.savingsDays/360.0;
}
return dNewInterest;
}//end addInterest
public double depositAmount(double amount, char type)
{
double dNewAmount = 0.0;
int iWrong;
if(amount>=0.0)
{
if(type == 'C')
{
dNewAmount = (amount) + this.getChecking();
}
else
{
if(type == 'S' )
{
dNewAmount = (amount) + this.getSavings();
}
else
{
dNewAmount = -1.0;
}
}
}
return dNewAmount;
}//end depositAmount
public double withdrawAmount(double amount, char type)
{
double dMoney = 0.0;
if(amount>=0.0)
{
if(type == 'C')
{
if(amount> getChecking())
{
dMoney= this.getChecking() - amount;
}
else{
dMoney = 0.0;
}
}
else{
if(type =='S')
{
if(amount> getChecking())
{
dMoney = this.getChecking() - amount;
}
else{
dMoney=0.0;
}
}
}
}
else{
dMoney = -1.0;
}
return dMoney;
}//end withdrawAmount
public static void clearScreen()
{
System.out.print("\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n");
System.out.print("\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n");
}//end clearScreen()
public String toString()
{
String strInfo = ""; //
strInfo+="\n\n\tAccount Information";
strInfo+="\n\t Name: " + this.name;
strInfo+="\n\t Account: " + this.account;
strInfo+="\n\t Checking: " + checkingAccount;
strInfo+="\n\t Saving: " + savingsAccount;
strInfo+="\n\t Saving Interest Rate: " + savingsInterestRate;
strInfo+="\n\t Days Accumulated: " + savingsDays;
return strInfo;
}//end toString()
}//end BankAccount