For this purpose we’ll use a simple queue but there are many other options in creating a log feature.
First create the Queue.
Queue<string> log = new Queue<string>();
Now update the Balance property to log when the value is set.
Finally we’ll create a method to return the log when called.
Let’s jump back into the program and add a new switch statement for calling our method and traverse the Queue.
Perfect! Now go ahead and use your ATM and then check the transactions.
There we go! Great work in creating your very first ATM!