Someone help me fix/finish this
hey need help finish this class
i use testpad lol
need make a method should display summary of the accounts details (e.g. account number, account balance and account owners name)
Also I think I messed up.
so tell me if i did.
//class for Account
public class Account
{
//Intstance variables
//stores account number
private int accountNumber;
//stores the money in account
private float accountBalance;
// owner of the accounts first name and last name
private String accountOwner;
final float INTEREST_RATE;
//Methods
//Method credit should add the amount to the current balance
public void credit(float amount)
{
accountBalance = accountBalance + amount;
}
//Method debit should withdraw money from an account object e.g. should subtract an amount from the account’s balance.
public void debit(float amount)
{
accountBalance = accountBalance - amount;
}
//method addInterest should calculate interest and add it to the account’s balance. Declare the interest rate as a constant
public void addInterest()
{
accountBalance = (accountBalance * INTEREST_RATE) + accountBalance;
//Method getBalance should return the current balance
public float getBalance()
{
return accountBalance;
}
//Method getAccNumber should return the account number.
public int getAccNumber()
{
return accountNumber;
}
public String getName()
{
return accountOwner;
}
//should display summary of the accounts details
System.out.println();
Thank for helping