So I have a method withdraw that just adds the amount of the withdraw to the list. So if then enter 400 to withdraw I just add that to the list. However when I print the list I want the withdraw to be negative. So the user enters a positive number, and when it prints I want it to be negative. This is what I have
What about creating a Transaction class, with fields TransactionType (that could be an enum), the amount involved and the date and time of the Transaction.
That would enable to do some interest calculations, given a list of periods and the interest rate in that period.
There are three kinds of actuaries: those who can count, and those who can't.
Yea, I figured that out last night. The first thing my mind wants to do is research for some kind of special method out there instead of just looking at it and take a simple approach. I do have have a menu in my Main class that allows for withdraw, deposit, check the balance, and calculate interest. As far as creating the other classes the instructor just wanted something simple, this is the first assignment of the class so its more of just to get us transitioning from java to c#
I am screwing myself right now though. So I want to add my transactions together to get the balance, and add that to my list. I think I just confused myself so bad. So here is my method
I want to add all the transactions in the list to the balance variable. So thats adding i to balance. so obviously += is wrong because that will add the starting balance twice, and because im returning balance that will return balance + balance, but im printing two number somehow. I get the balance + balance, but then it also prints my deposit to that balance + balance. I have been testing it with just a deposit from my menu