Welcome to the Java Programming Forums


The professional, friendly Java community. 21,500 members and growing!


The Java Programming Forums are a community of Java programmers from all around the World. Our members have a wide range of skills and they all have one thing in common: A passion to learn and code Java. We invite beginner Java programmers right through to Java professionals to post here and share your knowledge. Become a part of the community, help others, expand your knowledge of Java and enjoy talking with like minded people. Registration is quick and best of all free. We look forward to meeting you.


>> REGISTER NOW TO START POSTING


Members have full access to the forums. Advertisements are removed for registered users.

Results 1 to 2 of 2

Thread: Help with homework

  1. #1
    Junior Member
    Join Date
    Mar 2013
    Posts
    4
    Thanks
    1
    Thanked 1 Time in 1 Post

    Default Help with homework

    I registered late for an object oriented java class and I've been given a lab that I have no idea how to do. I'm going to start going through the textbook tonight, but we have a lab due tomorrow that I have not the slightest clue how to due. Any help would be appreciate:

    Write BankAccount class as discussed in the class, along the main class that uses it. Remember that two classes should be in separate files.
    1.) BankAccount class should have two instance variables; account holder's name and balance

    2.) Write a constructor method to set the value of the instance variable that contains the account holder's name to an empty string ("")

    3.) Add two constructor methods:
    a.) One that has account holder name and initial deposit amount as parameters, and
    b.) One that has only account holder name as a parameter. (This one should set the balance to 0.)

    4.) Write the accessors methods to get the account holder's name and balance in his account

    5.) Add an operation to transfer an amount from one bank account to another.

    6.) Add an operation to apply interest to the account. The interest amount should be .001 times the current account balance.

    Write the main method to:

    1.) Create two BankAccount objects. The holder of one account should be Edward Bennett, with an initial deposit of $10,000. The holder of the other account should be Lizzy Bennett, with no initial deposit.

    2.) Add an instruction to transfer $500 from Edward Bennett's account to Lizzy Bennett's account.

    3.) Add instructions to apply interest to each of the accounts.

    4.) Add instructions to print the name of the account holder followed by the current balance of the account for each of the two accounts.
    Would someone be so kind as to show me what this would look like so that I could study it and try to catch up on the material? I would be greatly appreciative.


  2. #2
    Super Moderator curmudgeon's Avatar
    Join Date
    Aug 2012
    Posts
    1,130
    My Mood
    Cynical
    Thanks
    64
    Thanked 140 Times in 135 Posts

    Default Re: Help with homework

    Quote Originally Posted by gta1 View Post
    I registered late for an object oriented java class and I've been given a lab that I have no idea how to do. I'm going to start going through the textbook tonight, but we have a lab due tomorrow that I have not the slightest clue how to due. Any help would be appreciate:



    Would someone be so kind as to show me what this would look like so that I could study it and try to catch up on the material? I would be greatly appreciative.
    No, it is not the place of this forum to do your homework for you. If you're looking for examples of OOP classes there are plenty to be found online. If you are looking for help here, then please show your best effort at a solution and ask a specific question. But please don't ask others to do assignments or grunt work for you.

    Locking.

Similar Threads

  1. Homework help?
    By regi.dg in forum Object Oriented Programming
    Replies: 0
    Last Post: October 16th, 2012, 08:17 PM
  2. HELP WITH HOMEWORK!!
    By jmillernc01 in forum What's Wrong With My Code?
    Replies: 3
    Last Post: October 10th, 2012, 11:13 AM
  3. Homework help
    By hockey15 in forum Object Oriented Programming
    Replies: 3
    Last Post: September 23rd, 2012, 11:28 PM
  4. I am doing my homework =D
    By valenciajv in forum Java Theory & Questions
    Replies: 9
    Last Post: October 7th, 2011, 04:39 PM
  5. Homework
    By jdonaldson in forum What's Wrong With My Code?
    Replies: 1
    Last Post: March 9th, 2011, 11:09 AM