Last active
December 28, 2021 19:39
-
-
Save domingoladron/4926595f4c1fb98dd538540f8f2b7b1c to your computer and use it in GitHub Desktop.
ATM-Machine-Class-Usage.cs
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
private static void CallGoodAtmMachine() | |
{ | |
//Call a factory to get back our atm interface implementation | |
var atmMachine = AtmMachineFactory.GetAtmMachine(); | |
atmMachine.Login(5555); | |
var balance = atmMachine.CheckBalance(accountId); | |
Console.WriteLine($"I checked my balance on account #{accountId}. The balance is now ${balance}"); | |
var myMoneyToSpend = atmMachine.Withdraw(20, accountId); | |
Console.WriteLine($"I withdrew some money from the ATM. I got out {myMoneyToSpend.Value}"); | |
balance = atmMachine.CheckBalance(accountId); | |
Console.WriteLine($"I checked my balance on account #{accountId}. The balance is now ${balance}"); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment