コード例 #1
0
        public LemonadeCorporation()
        {
            Lawyer myLawyer = new Lawyer();
            Stand  my_Stand = new Stand();

            CorpName = myLawyer.GetResponse("What would you like of the corporation of various stands to be called?");
            bool lemonFact = myLawyer.GetYesNo("Do you want to have any lemonade stands in your corporation?");

            if (lemonFact)
            {
                LemonStands = lemonStand.SetStands(myLawyer, LemonStands);
            }
            bool popsicleFact = myLawyer.GetYesNo("Do you want to have any popsicle stands in your corporation?");

            if (popsicleFact)
            {
                PopsiclesStands = popsicleStand.SetStands(myLawyer, PopsiclesStands);
            }
            bool hotdogFact = myLawyer.GetYesNo("Do you want to have any hotdog stands in your corporation?");

            if (hotdogFact)
            {
                HotdogStands = hotdogStand.SetStands(myLawyer, HotdogStands);
            }
        }
コード例 #2
0
        public void SetStands(Lawyer myLawyer, List <Stand> aStand)
        {
            int numofStands = myLawyer.GetInt("How many lemonade stands do you want to create?");

            for (int i = 0; i < numofStands; i++)
            {
                var ownerStand = new Stand();
                Console.WriteLine("For Stand #" + (i + 1));
                ownerStand.Name = myLawyer.GetResponse("What do you want to name this lemonade stand?");

                ownerStand.Predictivesell = myLawyer.GetInt("How many cups do you plan to sell at this stand?");
                ownerStand.Price          = myLawyer.GetDecimal("How much do you want to charge for cup of lemonade at this stand?");
                ownerStand.OwnerLoss      = myLawyer.GetDecimal("How much will this cost you per cup for this stand?");
                aStand.Add(ownerStand);
            }
        }