-
-
Save devjaime/cd8f05336f98525d26109aa66bdaa642 to your computer and use it in GitHub Desktop.
clase
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
| public class Account : IAccount | |
| { | |
| double _balance; | |
| public double CurrentBallance { get { return _balance; } } | |
| public double Deposit(double amount) | |
| { | |
| if (amount > 0) | |
| { | |
| _balance += amount; | |
| return _balance; | |
| } | |
| else | |
| { | |
| throw new ArgumentException("Invalid Deposit Amount!"); | |
| } | |
| } | |
| public double Withdraw(double amount) | |
| { | |
| if (amount > 0 && _balance >= amount) | |
| { | |
| _balance -= amount; | |
| } | |
| else | |
| { | |
| throw new ArgumentException("No balance to Withdraw!"); | |
| } | |
| return _balance; | |
| } | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment