Let’s Create, .NET! Project ATM Part 2 – Create our ATM class
1 min read

Let’s Create, .NET! Project ATM Part 2 – Create our ATM class

Let’s check that our test works.

Create a new class in the main project that will be an ATM object that will have a property for our balance.

    public class ATM
    {
        private int balance;
        public int Balance
        {
            get { return balance; }
            set { balance = value; }
        }
    }

Now let’s create a method that adds to our balance and returns our updated balance.

 public int Add(int amount)
 {
      return Balance = Balance + amount; 
 }

Perfect! Now in the next post we’ll test this method.

Leave a Reply