Let’s Create, .NET! Project ATM Part 6 – Add a log feature

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!

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s

%d bloggers like this: