Ejemplo n.º 1
0
 public Player()
 {
     wallet    = new Wallet();
     inventory = new Inventory();
     recipe    = new Recipe(4, 4, 4, 4);
     lemonade  = new Lemonade();
     expense   = 0m;
     profit    = 0m;
 }
Ejemplo n.º 2
0
        public LemonadeStand(recipe r)
        {
            this.pos           = 0;
            money              = 15;
            ingredientsInStock = Lemonade.InstantiateLemonade();
            currentRecipe      = r;

            pricePerCup  = .25;
            this.pitcher = new Pitcher(r);
            pitcher.cups = 0;
        }
Ejemplo n.º 3
0
        public LemonadeStand(recipe r, int pos)
        {
            //position it writes to
            this.pos = pos;

            money = 15;
            ingredientsInStock = Lemonade.InstantiateLemonade();
            currentRecipe      = r;

            pricePerCup  = .25;
            this.pitcher = new Pitcher(r);
            pitcher.cups = 0;
        }
Ejemplo n.º 4
0
        public void buyItems()
        {
            recipe stock = Lemonade.InstantiateLemonade();


            double [] lemons = UI.promptForMoney("Lemon", .10);
            double [] sugar  = UI.promptForMoney("Sugar", .12);
            double [] ice    = UI.promptForMoney("Ice Cube", .01);
            this.pricePerCup = UI.promptForDouble("Price / Cup: ");
            stock.Lemon     += (int)lemons[0];
            stock.Sugar     += (int)sugar[0];
            stock.Ice       += (int)ice[0];
            this.money      -= lemons[1] + sugar[1] + ice[1];
            this.stockItems(stock);
        }
Ejemplo n.º 5
0
        private void RunOneDay()
        {
            UserInterface.DisplayCash(player1);
            UserInterface.DisplayInventory(player1);
            Day currentDay = new Day(random);

            RequestInventoryRefill();
            Lemonade recipe = new Lemonade();

            player1.Store.SellLemonade(currentDay, recipe);
            player1.Store.CalculateDailyProfitLoss(currentDay.Sales);
            player1.Store.CalculateRunningProfitLoss(currentDay.Sales);
            UserInterface.DisplayDailyResults(player1, currentDay);
            player1.Store.DaysOpen += 1;
            player1.Store.UpdateMoney(currentDay.Sales);
        }
Ejemplo n.º 6
0
        static void Main(string[] args)
        {
            Lemonade myStand1 = new Lemonade();
            myStand.NameOfStand = "Good Lemonade";
            myStand.NumberOfCups = 100;
            myStand.Price = 1;
            myStand.Cost = .25;

            Lemonade myStand2 = new Lemonade();
            myStand2.NameOfStand = "Really Good Lemonade";
            myStand2.NumberOfCups = 200;
            myStand2.Price = 1.50;
            myStand2.Cost = .50;

            List<LemonadeStand> lemonadeStandList = new List<LemonadeStand>();
           
            foreach (string lemonadestand in lemonadeStandList)
            {
                lemonadeStandList.Add();
            }
            

            Console.WriteLine("Welcome!");
            Console.WriteLine("What will the name of your lemonade stand be?");
            string NameOfStand = Console.ReadLine();

            Console.WriteLine("Thanks!");
            Console.WriteLine("Your stand will be called " + NameOfStand);

            Console.WriteLine("How many cups will you sell:");
            int NumberOfCups = Int32.Parse(Console.ReadLine());

            Console.WriteLine("Thanks!");
            Console.WriteLine("How much will you sell each cup for?");

            decimal Price = Int32.Parse(Console.ReadLine());
            decimal Revenue = NumberOfCups * Price;
        }
Ejemplo n.º 7
0
        static void Main(string[] args)
        {
            Lemonade myStand = new Lemonade();
            myStand.NameOfStand = "Good Lemonade";
            myStand.NumberOfCups = 100;
            myStand.Price = 1;
            myStand.Cost = .25;

            Console.WriteLine("Welcome!");
            Console.WriteLine("What will the name of your lemonade stand be?");
            string NameOfStand = Console.ReadLine();

            Console.WriteLine("Thanks!");
            Console.WriteLine("Your stand will be called " + NameOfStand);

            Console.WriteLine("How many cups will you sell:");
            int NumberOfCups = Int32.Parse(Console.ReadLine());

            Console.WriteLine("Thanks!");
            Console.WriteLine("How much will you sell each cup for?");

            decimal Price = Int32.Parse(Console.ReadLine());
            decimal Revenue = NumberOfCups * 
        }
Ejemplo n.º 8
0
        private void ProducePitchers(int amtLemons, int amtSugar, int amtIce, int numPitchers, double price, string mixName)
        {
            double cost = (mySupplier.ALemon.Price * amtLemons) + (mySupplier.ACupOfSugar.Price * amtSugar) + (mySupplier.AnIceCube.Price * amtIce);

            if (amtLemons > 0)
            {
                MySupplies.RemoveSupply(MySupplies.MyLemons, amtLemons * numPitchers);
            }
            if (amtSugar > 0)
            {
                MySupplies.RemoveSupply(MySupplies.MySugar, amtSugar * numPitchers);
            }
            if (amtIce > 0)
            {
                MySupplies.RemoveSupply(MySupplies.MyIce, amtIce * numPitchers);
            }


            for (int i = 0; i < numPitchers; i++)
            {
                Lemonade thisMix = new Lemonade("Lemonade", 0, price, cost, amtLemons, amtSugar, amtIce, mixName);
                mySupplies.myLemonadePitchers.Add(thisMix);
            }
        }
Ejemplo n.º 9
0
 public void SellLemonade(Day currentDay, Lemonade lemonade)
 {
     for (int i = 0; i < currentDay.PotentialCustomers.Count; i++)
     {
         if (currentDay.PotentialCustomers[i].MaxWillingToPay < lemonade.PricePerCup)
         {
             currentDay.PotentialCustomers[i].CupsBought = 0;
         }
         else if (currentDay.PotentialCustomers[i].MaxWillingToPay >= lemonade.PricePerCup)
         {
             if (currentDay.PotentialCustomers[i].LemonPreference == lemonade.LemonAmount && currentDay.PotentialCustomers[i].SugarPreference == lemonade.SugarAmount && currentDay.PotentialCustomers[i].IcePreference == lemonade.IceAmount)
             {
                 currentDay.PotentialCustomers[i].CupsBought = 3;
                 currentDay.Sales += (3 * lemonade.PricePerCup);
                 currentDay.Customers.Add(currentDay.PotentialCustomers[i]);
                 if (!inventory.RemoveLemons(3 * lemonade.LemonAmount))
                 {
                     UserInterface.AlertEmptyInventoryItem("lemons");
                     break;
                 }
                 if (!inventory.RemoveSugar(3 * lemonade.SugarAmount))
                 {
                     UserInterface.AlertEmptyInventoryItem("sugar");
                     break;
                 }
                 if (!inventory.RemoveIce(3 * lemonade.IceAmount))
                 {
                     UserInterface.AlertEmptyInventoryItem("ice");
                     break;
                 }
                 if (!inventory.RemoveCups(3))
                 {
                     UserInterface.AlertEmptyInventoryItem("cups");
                     break;
                 }
             }
             else
             {
                 int amount = random.Next(2);
                 if (amount == 0)
                 {
                     currentDay.PotentialCustomers[i].CupsBought = 0;
                 }
                 else if (amount == 1)
                 {
                     currentDay.PotentialCustomers[i].CupsBought = 1;
                     currentDay.Sales += lemonade.PricePerCup;
                     currentDay.Customers.Add(currentDay.PotentialCustomers[i]);
                     if (!inventory.RemoveLemons(lemonade.LemonAmount))
                     {
                         UserInterface.AlertEmptyInventoryItem("lemons");
                         break;
                     }
                     if (!inventory.RemoveSugar(lemonade.SugarAmount))
                     {
                         UserInterface.AlertEmptyInventoryItem("sugar");
                         break;
                     }
                     if (!inventory.RemoveIce(lemonade.IceAmount))
                     {
                         UserInterface.AlertEmptyInventoryItem("ice");
                         break;
                     }
                     if (!inventory.RemoveCups(1))
                     {
                         UserInterface.AlertEmptyInventoryItem("cups");
                         break;
                     }
                 }
             }
         }
     }
 }