Created
October 10, 2013 03:43
-
-
Save copypastedeveloper/6912714 to your computer and use it in GitHub Desktop.
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 Customer | |
| { | |
| public decimal AccountBalance { get; set; } | |
| public List<Orders> Orders { get; set; } | |
| public string Name { get; set; } | |
| public void AddMoney(decimal amountToAdd) | |
| { | |
| AccountBalance += amountToAdd | |
| } | |
| public void PlaceOrder(string iceCreamFlavor, decimal price) | |
| { | |
| if (AccountBalance >= price) | |
| { | |
| AccountBalance-=price; | |
| Orders.Add(new Order { Flavor = iceCreamFlavor }); | |
| return; | |
| } | |
| throw new InsufficientFundsException(); | |
| } | |
| } | |
| public class Order | |
| { | |
| public string Flavor { get; set; } | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment