Skip to content

Instantly share code, notes, and snippets.

@devjaime
Created March 18, 2019 02:08
Show Gist options
  • Select an option

  • Save devjaime/cd8f05336f98525d26109aa66bdaa642 to your computer and use it in GitHub Desktop.

Select an option

Save devjaime/cd8f05336f98525d26109aa66bdaa642 to your computer and use it in GitHub Desktop.
clase
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