Results 1 to 2 of 2
  1. #1
    Apertin is offline Member
    Join Date
    Oct 2010
    Posts
    1
    Rep Power
    0

    Unhappy 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 accounts balance.
    public void debit(float amount)
    {
    accountBalance = accountBalance - amount;

    }

    //method addInterest should calculate interest and add it to the accounts 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

  2. #2
    KevinWorkman's Avatar
    KevinWorkman is offline Crazy Cat Lady
    Join Date
    Oct 2010
    Location
    Washington, DC
    Posts
    3,874
    Rep Power
    8

    Default

    Quote Originally Posted by Apertin View Post
    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.
    That's not how this works. What did you try? What did you expect it to do? Did it do what you expected it to do? What did it do instead? Did you see any Exceptions or weird behavior- and what were they? Be specific. Ask a specific question.

    When posting code, make sure you use the code tags to preserve formatting.

Similar Threads

  1. help me to finish my project..
    By syedabu in forum NetBeans
    Replies: 1
    Last Post: 07-19-2010, 09:13 PM
  2. how to finish this?
    By xpandaxlover in forum New To Java
    Replies: 2
    Last Post: 04-09-2010, 07:43 PM
  3. how to finish this?
    By xpandaxlover in forum New To Java
    Replies: 1
    Last Post: 04-09-2010, 07:42 PM
  4. convert please...to finish project
    By syedabu in forum Web Frameworks
    Replies: 1
    Last Post: 02-24-2010, 07:17 PM
  5. Next, Finish Buttons !!!
    By pele in forum SWT / JFace
    Replies: 1
    Last Post: 07-14-2007, 05:22 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •