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); } }
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); } }
public List <Hotdog> SetStands(Lawyer myLawyer, List <Hotdog> aStand) { int numofStands = myLawyer.GetInt("How many " + Type + " stands do you want to create?"); for (int i = 0; i < numofStands; i++) { var ownerStand = new Hotdog(); Console.WriteLine("For Stand #" + (i + 1)); ownerStand.Name = myLawyer.GetResponse("What do you want to name this " + Type + " stand?"); ownerStand.Predictivesell = myLawyer.GetInt("How many " + Item + "s do you plan to sell at this stand?"); ownerStand.Price = myLawyer.GetDecimal("How much do you want to charge for a " + Item + " of " + Type + " at this stand?"); ownerStand.OwnerLoss = myLawyer.GetDecimal("How much will this cost you per " + Item + " for this stand?"); aStand.Add(ownerStand); } return(aStand); }
static void Main(string[] args) { //Stand ownerStand = new Stand(); Lawyer bestLawyer = new Lawyer(); LemonadeCorporation p_n_f = new LemonadeCorporation(); int numlemonStands = p_n_f.LemonStands.Count; int numpopsicleStands = p_n_f.PopsiclesStands.Count; int numhotDogStands = p_n_f.HotdogStands.Count; if (numlemonStands > 0) { p_n_f.AddTogether(p_n_f.LemonStands); } if (numpopsicleStands > 0) { p_n_f.AddTogether(p_n_f.PopsiclesStands); } if (numhotDogStands > 0) { p_n_f.AddTogether(p_n_f.HotdogStands); } Console.WriteLine("Total Revenue for Coorporation: " + p_n_f.TotalRevenue); Console.WriteLine("Total Expenses for Coorporation: " + p_n_f.TotalExpenses); Console.WriteLine("Total Profit for Coorporation: " + p_n_f.TotalProfit); bool fact = bestLawyer.GetYesNo("Do you want to get the individual information for each type stand"); if (fact) { p_n_f.lemonStand.PrintIndivInfoLemonStands(p_n_f.LemonStands); p_n_f.popsicleStand.PrintIndivInfoPopsicleStands(p_n_f.PopsiclesStands); p_n_f.hotdogStand.PrintIndivInfoHotdogStands(p_n_f.HotdogStands); } else { Console.WriteLine("Alright have a wonderful day then."); } Console.ReadLine(); }