Results 1 to 4 of 4

Thread: help me please

  1. #1
    vquad is offline Member
    Join Date
    Aug 2010
    Posts
    2
    Rep Power
    0

    Default help me please

    You are required to declare the classes as below:
    Account
    -owner: Customer
    -accountNo: int
    -balance: double
    + Account()
    + Account(owner: Customer, accountNo: int, balance: double)
    +setOwner(owner: Customer): void
    +getOwner(): Customer
    +setAccountNo(accountNo: int): void
    +getAccountNo(): int
    +setBalance(balance:double): void
    +getBalance(): double
    +deposit(amount:double):boolean
    +withdraw(amount:double):boolean



    Customer
    -name : String
    -icNo : String
    +Customer()
    +Customer(name: String, icNo: String)
    +setName(name: String): void
    +getName(): String
    +setIC(icNo: String):void
    +getIC():String


    The following are the requirements needed:
    1. Deposit method:
    a. Do a checking on the amount given. Perform the update on current balance only if the amount is greater than zero. Return true if deposit is successful and false otherwise.
    2. Withdraw method:
    a. Do a checking on the amount given. Deduct from current balance only if the amount is less than the balance and the balance after deduction should not be less than RM10.00. Return true if withdrawal is successful and false otherwise.

    Then create a Bank class that will instantiate an object of type Account and Customer. Request the user to enter the information for the newly created Customer object and Account object.

    Your Bank class then should allow the following options:

    1 – Deposit
    2 – Withdraw
    3 – Check Balance
    0 – Exit

    These options should be displayed repeatedly until the user enters 0. Once option 0 is chosen, display a “Thank you” message and terminate from the application.

  2. #2
    JosAH's Avatar
    JosAH is online now Moderator
    Join Date
    Sep 2008
    Location
    Voorschoten, the Netherlands
    Posts
    13,371
    Blog Entries
    7
    Rep Power
    20

    Default

    You go first; this forum is not a free homework service.

    kind regards,

    Jos

  3. #3
    vquad is offline Member
    Join Date
    Aug 2010
    Posts
    2
    Rep Power
    0

    Default

    i hav done it but i stuck at
    +deposit(amount:double):boolean
    +withdraw(amount:double):boolean
    can help me?? i no really understand with boolean.......

  4. #4
    maknib is offline Member
    Join Date
    Nov 2010
    Posts
    90
    Rep Power
    0

    Default

    Quote Originally Posted by vquad View Post
    i hav done it but i stuck at
    +deposit(amount:double):boolean
    +withdraw(amount:double):boolean
    can help me?? i no really understand with boolean.......
    hi.

    WWW

    What did you try?

    What happened when you tried it (what error did you get, what went wrong)

    What did you expect to happen(what did you want it to do?)


    the good folks here cannot read your mind and figure this out, you need to supply more information, maybe some code an explanation, something other than..

    help! it did not work, fix it for me

Posting Permissions

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