• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Paul Clapham
  • Tim Cooke
  • Jeanne Boyarsky
  • Liutauras Vilda
Sheriffs:
  • Frank Carver
  • Henry Wong
  • Ron McLeod
Saloon Keepers:
  • Tim Moores
  • Frits Walraven
  • Tim Holloway
  • Stephan van Hulst
  • Carey Brown
Bartenders:
  • Al Hobbs
  • Piet Souris
  • Himai Minh

Bank application

 
Greenhorn
Posts: 13
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi, I am creating a bank application where it is possible for the user to deposit or withdraw money. I have to create three classes. The first one should just implement the class "account", the second one should test the methods in the class "account" using a main-method. The actual banking application is created in the third class.

I am really not sure if I am on track, could you please take a look and give me some tips?
private.png
[Thumbnail for private.png]
 
Bartender
Posts: 2270
20
Android Java ME Eclipse IDE Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
How the other classes look like?
 
Marshal
Posts: 76419
365
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Please copy'n'paste your code rather than using screenshots.
Please use proper names for the variables: number please rather than nbr.
Don't use the double datatype for money. Either use longs and denominate the money in cents/pence, or use BigDecimals. For more information look at this discussion and the two links in the post that appears first.
 
Campbell Ritchie
Marshal
Posts: 76419
365
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Please omit the two setXXX() methods. It should only be possible to change the balance in an account by putting money in (depositcredit()) or taking money out (withdraw()).
 
Are you okay? You look a little big. Maybe this tiny ad will help:
the value of filler advertising in 2021
https://coderanch.com/t/730886/filler-advertising
reply
    Bookmark Topic Watch Topic
  • New Topic