Yahoo Answers is shutting down on May 4th, 2021 (Eastern Time) and the Yahoo Answers website is now in read-only mode. There will be no changes to other Yahoo properties or services, or your Yahoo account. You can find more information about the Yahoo Answers shutdown and how to download your data on this help page.
Trending News
Java bank question, help needed?
Okay im having problems with understanding how to design a java program in order to make it seem like a bank.
i basically have to be able to withdraw money, an entered amount
i also have to be able to deposit money, also an entered amount
and then finally quit the application.
and i also need to set an overdraft limit so if too much money is taken out then a statement such as
invalid amount requested overdraft limit reached is shown
im very very confused at this so any help would be great, im not asking to write the code out but to just help explain how i would start this question would be great
3 Answers
- muleLv 41 decade ago
Well, let's say you only need 1 account - having multiple accounts would be more difficult.
Note: links to code here will be the pastebin links. There, the codes will be easier to read and decipher. Give it a shot at each step, then look at the code to see how well what you did matched with mine. The final one will be a complete solution, but I highly recommend doing it on your own and using this as a guide. If you just copy my solution, bad things WILL happen (get caught, etc.)
let's start with http://pastebin.com/m18679625
It has no operational code on the inside, but it gets you started.
Now, let's add a menu.
changes: added import, added Scanner, added menu output, added input selection, added case statements
Now, let's implement the functionality in the switch case
The final result is here: http://pastebin.com/ma4810ff
Good luck!
remember - do your best on your own from the first couple steps before moving on. Especially between the second and third code sample.
- NeunerballLv 41 decade ago
Check http://java.sun.com/docs/books/tutorial/java/conce... this will give you a start. It's about Object-Oriented Programming (OOP) once you understand the concept of it, you shouldn't have a problem with your "bank". If you need to know more about Java itself, click on the trail link on the top of the page. You'll get a list of more chapters of the Java tutorial, continue with Language Basics.
- 1 decade ago
Yahoo! Answers is not the place for programming questions, head over to stackoverflow.com. But they will not do homework for you.