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 3 of 3

Thread: Banking System UML Class Diagram in to code.

  1. #1
    Member
    Join Date
    Oct 2011
    Posts
    114
    Thanks
    1
    Thanked 0 Times in 0 Posts

    Default Banking System UML Class Diagram in to code.

    Hi again,

    today we got given this problem:

    The LandL bank can handle at least 30 customers who have savings accounts.

    * Design and then implement a program which manages deposits and withdrawls.
    * Produce suitable error messages for invalid transactions
    * Add a method which adds 3% to all accounts when it is invoked.


    In class today we designed a class diagram in a group and this is our result: (tutor said tis fine and now we need to code it):

    Bank Class
    -customers: ArrayList<Customer>
    +getCustomerById(int): Customer

    Customer Class
    -customerId: int
    -name: String
    -accounts: ArrayList<Account>
    +getCustomerId()
    +getName()
    +getAccount(int)

    Account Class
    -accountId: int
    -balance: double
    +getId(): int
    +getbalance(): double
    +deposit(double)
    +withdraw(double)
    +rasieByPercentage(double)


    I am using netbeans to code this in java

    I have a few questions please that would help me get started.

    How many Main classes and normal classes do i need?
    What should the programs actually do?
    do i create 30 names for customers in an Array?
    do i ask for user input by typing in a name and then ask what they want to do i.e. make a deposit, make a withdrawal and request balance
    What do they mean by: Add a method which adds 3% to all accounts when it is invoked.


    Many thanks for your help


  2. #2
    Super Moderator helloworld922's Avatar
    Join Date
    Jun 2009
    Posts
    2,895
    Thanks
    23
    Thanked 619 Times in 561 Posts
    Blog Entries
    18

    Default Re: Banking System UML Class Diagram in to code.

    According to your specifications, there are no "main classes" (I'm assuming this refers to classes with the static entry-point main method). However, I would create a separate class (i.e. not one listed above) that you does have a main method and allows you to test your other classes with.

    The specifications seem to denote that your program should act like a library that can be used by some front end (either a command-line app, gui app, or even web-based app). It's also possible that the front end has no user interface at all, for example a test class which runs the library with different parameters and test situations to make sure it works.

    You're already using an ArrayList in your bank class, why would you need a second array?

    Ideally your program should not ask for any user input, it should receive method parameters and operate on those. If you wanted to you can create a separate front end which you can play around your library with.

    It sounds like you're suppose to increase the amount of money in each account by 3% of its previous value.

  3. #3
    Member
    Join Date
    Oct 2011
    Posts
    114
    Thanks
    1
    Thanked 0 Times in 0 Posts

    Default Re: Banking System UML Class Diagram in to code.

    Do i create an ArrayList and just do a list of 30 customer IDs?

    And this is in the customer class?

    In the account class i assign a balance (double) to each customer ID?


    Is that right?

Similar Threads

  1. [SOLVED] New to java, need to know how to incorparate system time into a block of code.
    By lostbit in forum Java Theory & Questions
    Replies: 5
    Last Post: September 29th, 2011, 07:46 AM
  2. banking system
    By preeti in forum Java Theory & Questions
    Replies: 3
    Last Post: August 11th, 2011, 01:25 PM
  3. Simple Banking System
    By ShadowKing98 in forum Java Theory & Questions
    Replies: 7
    Last Post: April 12th, 2011, 04:26 AM
  4. Banking Application
    By mbouster in forum Object Oriented Programming
    Replies: 2
    Last Post: January 9th, 2011, 11:23 AM
  5. UML Class Diagram
    By LDM91 in forum Java Theory & Questions
    Replies: 4
    Last Post: December 27th, 2010, 12:04 PM