This week's book giveaway is in the Servlets forum.
We're giving away four copies of Murach's Java Servlets and JSP and have Joel Murach on-line!
See this thread for details.
The moose likes Beginning Java and the fly likes Need help with a small Java project Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Murach's Java Servlets and JSP this week in the Servlets forum!
JavaRanch » Java Forums » Java » Beginning Java
Bookmark "Need help with a small Java project" Watch "Need help with a small Java project" New topic
Author

Need help with a small Java project

Yann Danis
Greenhorn

Joined: Jan 02, 2012
Posts: 13
Hi, I'm doing a bank account project and I have a problem ...
I would like the result of the output of my program to give me something like this:


The classes wich I may have to modify are the following :





When I execute I dont get any errors I just dont get anything I think I should add something in my transacList I just dont know what...

Thank you for your time and I appreciate any help.
Jeff Verdegan
Bartender

Joined: Jan 03, 2004
Posts: 6109
    
    6

Welcome to the Ranch!

Here are a couple tips to make your experience here more productive and ensure you get the best help possible.

1) You didn't tell us what it's doing instead. Please TellTheDetails.

2) That's way too much code. We don't need to see your whole program. Provide just enough to show the specific problem you're asking about, and nothing else. Often times this means writing a completely separate, smaller program--an SSCCE.

EDIT: Okay, I see you've updated your post. That looks better. So, when you say you "don't get anything", you mean there's no output at all? What output do you expect?
Yann Danis
Greenhorn

Joined: Jan 02, 2012
Posts: 13
Jeff Verdegan wrote:
So, when you say you "don't get anything", you mean there's no output at all? What output do you expect?


The output I would like to have when my project is done is what I have posted before posting my classes but for now I'd like anything at least so I can try and work on something... xD
Unnar Björnsson
Ranch Hand

Joined: Apr 30, 2005
Posts: 164
It's never good idea to post that much code unless you are sure it's all relevant to the problem you are having. It is also preferred that you write your code in english because when someone starts to read someone elses code he looks at variable and method names to understand it faster, in your case you have written your code in french if I'm not mistaken which makes it more difficult to read for someone that doesn't know french (me for instance).
Unnar Björnsson
Ranch Hand

Joined: Apr 30, 2005
Posts: 164
If you are having output problems the simplest way to debug it is to output some extra debug text at appropriate places in your code to narrow the possible cause. I'd check if that for loop at line:95 is being executed as it should. In other words, work you way backwards until you find the source of the problem.
Yann Danis
Greenhorn

Joined: Jan 02, 2012
Posts: 13
I think I have to modify something in the class Compte so that each depot, retrait or transfer create an occurrence of the class Transaction wich will be save in the ArrayList named transacList inside the object compte I just dont know how to do it...

If you need me to put my code in english so that you can help me I will...
Unnar Björnsson
Ranch Hand

Joined: Apr 30, 2005
Posts: 164
The reason you are not getting any output is that transacList is empty. What is missing is adding a new Transaction object to that list when deposit, withdrawal or transfer is made on the account.
Yann Danis
Greenhorn

Joined: Jan 02, 2012
Posts: 13
Thanks peaple I finally got this on the run. ;)
Campbell Ritchie
Sheriff

Joined: Oct 13, 2005
Posts: 37913
    
  22
Why do you have a static class inside the enum?
Yann Danis
Greenhorn

Joined: Jan 02, 2012
Posts: 13
Campbell Ritchie wrote:Why do you have a static class inside the enum?

nvm that I fix that project
Campbell Ritchie
Sheriff

Joined: Oct 13, 2005
Posts: 37913
    
  22
Yann Danis wrote: . . . nvm that I fix that project
What on earth does that mean? Please avoid abbreviations like nvm.
Yann Danis
Greenhorn

Joined: Jan 02, 2012
Posts: 13
Campbell Ritchie wrote:
Yann Danis wrote: . . . nvm that I fix that project
What on earth does that mean? Please avoid abbreviations like nvm.


Sorry about that when your used to it you dont think about the fact that its not everyone that understands.

nvm = never mind xD
 
It is sorta covered in the JavaRanch Style Guide.
 
subject: Need help with a small Java project
 
Similar Threads
help creating mutator
another kind of Exception in thread "AWT-EventQueue-0" java.lang.OutOfMemoryError: Java heap space
Creating a class
executing the program.
Problem while executing the program