Java help - using an ArrayList to record variables
To start off, I'm a complete n00b in coding. I mainly learn through experience and asking questions in Java, not books. I read 3 books about ArrayLists but all i learned is how to input values into ArrayLists directly, not recording new values in the variables. I tried for 2 weeks to figure this out but I only understand 50% of what my professor wants.
I need help with this program I'm trying to make. It is essetially a program that acts like an ATM.
As of now it codes for entering the initial balance using a JOptionPane.
a GUI pops up asking if you want to enter a transaction (which is
already coded for), listing all the transactions, listing all the
checks, an listing all the deposits.
I'm planning for the output to be just text (which will help later when i need to create a textbox for a window.
was starting to code for an ArrayList (which I have 0 expericence in)
so that it records everytime a new Transaction occurs. For some reason
my teacher tells me I'll need the Tranaction class, so if you can
explain the purpose of this it would be great.
The file is a
zip that when extracted could be opened with NetBeans. If you don't use
NetBeans go to "Assignment2.zip\Assignment2
(3)\Assignment2\Assignment2\src\assignment2" and there will be 4 .class
files that can be opened as text files and just copy and paste it to
I'm doing so bad in this class
If you even attempt to do this you have a heart of gold. Ty so much!
In addition, here is a description of the program.
The program asks the input of the deposit to open the account, then with
the GUI you can enter transactions, once you are done (press 0 for the
codeNum) then it displays the current balance, then the service charges,
then the balance after service charges.
After that it goes to
the GUI again then you can press "List all transactions" then it is
supposed to list all the transactions in order with the type (check,
deposit, or service charge), and the amount. Sane with "List all checks"
and "list all deposits".
b_redeker last edited by
We're not going to do your homework for you. Start programming. Make mistakes. If then you have a particular piece of code you can't get to work, post that and then ask for specific help.
In the meantime, I suggest you take a look at the ArrayList class. I'm fairly sure there'll be a way to get a specific element.
Just had a eureka moment, going to see if this works, but why i came here is, as i said, I'be been working on this for two weeks, on and off, and virtually no hope is left. Hopefully my idea works...
This certainly is not my intention. My peers and teacher are old school programmers and I've asked them to explain, but it is very difficult for me to understand. I take pride in my work, wither it be coding or otherwise. But your suggestion of being more specific is justified, but very ifficult for me to elborate further. It's like me asking you to explain how protein kinases in cell signling work an the benefits of this system instead of just one messenger. Anyways, here is my attempt at explaining my elaboration: EOptionsPanel class doesn't need any editing, it sets up the GUI well. The Main class helper methods "listTrans", "listWithdrawsm" and "listDeposits" need to be created but I'm going to try to figure that out on my own when this ArrayList problem is fixed. Here is where my question asking for help come in. I need to set up an ArrayList
May I direct you specifically to the sections "Choose your forum carefully" (this isn't generally a forum for beginner students in languages) and "Don't post homework questions" (one of the things we don't tend to do, unless they're interesting. Student assignments are rarely interesting,) though the whole thing is probably worth a read.
Especially before posting for the first time on somewhere for answers to homework.