Need Help with Java again

Collapse

Recommended Videos

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • Dtownballa
    MVP
    • Feb 2003
    • 1450

    #1

    Need Help with Java again

    Hey guys its me again:

    And you guys were such a great help last time, and im stick again on this new assignment. Can anybody please help me or give me ideas that'd be great.


    And I'm not sure how to use an array, so any help with that would be aprechated .

    Thanks guys.
    ------


    We Love Your Money Bank is a small bank with only 10 customers. Their customer numbers are 1, 2, 3, 4, 5, 6, 7, 8, 9, 10. All customers have a simple savings account.
    They can only deposit or withdrawal money from their accounts. If the customer
    withdrawals an amount, then it is entered as a negative number such as -5.00 (The customer is withdrawing $5.00) otherwise it is just a number such as 7.00 (The customer is depositing $7.00).

    Write a JAVA program that will ask for the customer number and the amount. Use an array to hold the account balances. Print out the results in customer number order when all transactions are complete. You may assume that all bank accounts start at zero although you may initialize their accounts to any positive numbers, if you like.

    Error Checking:

    Do not allow a customer number less than 1 or greater than 10.
    Do not allow a customer to withdrawal more than they have in their account.

    Note:

    There is no need to "sort" the array.
    Please use GUI input and output dialog boxes.
    Make sure there is a "We Love Your Money Bank" heading.
    Make sure the customer numbers and amounts line up in columns.
    Create a Total On Deposit Amount at the end.

    Use a standard flowchart for this program.
    Attached Files
    PSN: The_TechNinja
    Check me out on YouTube as well: http://tinyurl.com/lqd6s9j
  • dagger55
    No end in sight...
    • Jul 2004
    • 7907

    #2
    Re: Need Help with Java again

    So what part are you struggling with? This seems like a pretty easy assignment...

    Comment

    • Dtownballa
      MVP
      • Feb 2003
      • 1450

      #3
      Re: Need Help with Java again

      Originally posted by dagger55
      So what part are you struggling with? This seems like a pretty easy assignment...
      This is my first java class.

      I never used an Array, and I attached is my flow chart.

      I never did programming in my life, I do hardware and networking.

      It's just a required class.


      Could you tell me how you would approach this ?
      PSN: The_TechNinja
      Check me out on YouTube as well: http://tinyurl.com/lqd6s9j

      Comment

      • dagger55
        No end in sight...
        • Jul 2004
        • 7907

        #4
        Re: Need Help with Java again

        I would have an array of 10 elements with type double.

        I would then have a UI that took on a customer number and amount, and put that amount in array[custNum - 1].

        Before doing that I would make sure custNum is >0 and <11, and if the amount is negative, make sure it is greater than that total amount/2

        The GUI can be done in plenty of ways. There are lots of examples on how to make a simple GUI.

        Comment

        Working...