예제 #1
0
        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);
                }
            }
        }
예제 #2
0
        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);
                }
            }
        }
예제 #3
0
 public Nickle()
 {
     value     = 0.05;
     this.name = "Nickle";
     Coin nickle = new Nickle();
 }