public Wallet() { coinsInWallet = new List <Coin>(); { for (int i = 0; i < 50; i++) { Penny penny = new Penny(); coinsInWallet.Add(penny); } for (int i = 0; i < 20; i++) { Nickle nickle = new Nickle(); coinsInWallet.Add(nickle); } for (int i = 0; i < 10; i++) { Dime dime = new Dime(); coinsInWallet.Add(dime); } for (int i = 0; i < 20; i++) { Quarter quarter = new Quarter(); coinsInWallet.Add(quarter); } } }
public SodaMachine() { register = new List <Coin>(); { for (int i = 0; i < 50; i++) { Penny penny = new Penny(); register.Add(penny); } for (int i = 0; i < 20; i++) { Nickle nickle = new Nickle(); register.Add(nickle); } for (int i = 0; i < 10; i++) { Dime dime = new Dime(); register.Add(dime); } for (int i = 0; i < 20; i++) { Quarter quarter = new Quarter(); register.Add(quarter); } } inventory = new List <Can>(); { for (int i = 0; i < 10; i++) { Cola cola = new Cola(); inventory.Add(cola); } for (int i = 0; i < 10; i++) { OrangeSoda orangeSoda = new OrangeSoda(); inventory.Add(orangeSoda); } for (int i = 0; i < 10; i++) { RootBeer rootBeer = new RootBeer(); inventory.Add(rootBeer); } } }
public Penny() { value = 0.01; this.name = "Penny"; Coin penny = new Penny(); }