public void makeLemonStands() { int numofstands = UserInteraction.GetUserInputInt("Lets open some lemonade stands, how many would you like to open?"); for (int i = 0; i < numofstands; i++) { LemonadeStand newstand = new LemonadeStand(); Console.WriteLine($"What is the name of location {i + 1} ?"); newstand.standName = Console.ReadLine(); newstand.numSold = UserInteraction.GetUserInputInt("How many cups will this location sell?"); newstand.customerPrice = UserInteraction.GetUserInputDecimal("What will your price to sell the lemonade be?"); newstand.sellerCost = UserInteraction.GetUserInputDecimal("How much does it cost you to make the lemonade"); Console.WriteLine($"This stands total revenue will be: { newstand.getTotalRevenue()}"); Console.WriteLine("The stands total expenses are: " + newstand.getTotalExpense()); Console.WriteLine("Your total profit of " + newstand.standName + " is " + newstand.getTotalProfit()); LemonLocations.Add(newstand); } }
static void Main(string[] args) { Console.WriteLine("Hey!"); Console.WriteLine("How many lemonade stands would you like to open?"); int numberOfLemonadeStands = int.Parse(Console.ReadLine()); List <LemonadeStand> locations = new List <LemonadeStand>(); for (int i = 0; i < numberOfLemonadeStands; i++) { LemonadeStand lemonadeStand = new LemonadeStand(); Console.WriteLine("What is the name of location " + (i + 1) + "?"); lemonadeStand.Name = Console.ReadLine(); Console.WriteLine("How many cups will you sell?"); lemonadeStand.NumberOfCups = Int32.Parse(Console.ReadLine()); Console.WriteLine("How much will you sell each cup for?"); lemonadeStand.PricePerCup = decimal.Parse(Console.ReadLine()); Console.WriteLine("How much will each cup cost to make?"); lemonadeStand.CostPerCup = decimal.Parse(Console.ReadLine()); Console.WriteLine("You'll be opening a stand called " + lemonadeStand.Name + "."); Console.WriteLine("If you sell all " + lemonadeStand.NumberOfCups + "cups"); Console.WriteLine("Your total revenue will be $" + lemonadeStand.GetTotalRevenue() + "."); Console.WriteLine("Your total expnses will be $" + lemonadeStand.GetTotalExpenses() + "."); Console.WriteLine("Your total profit will be $" + lemonadeStand.GetTotalProfit() + "."); } Console.ReadLine(); }
public Player(string name) { this.name = name; cashBox = new CashBox(); lemonadeStand = new LemonadeStand(); daysPlayed = 1; }
public bool BuyLemonade(string pitcherType, LemonadeStand lemonadeStand) { int overallInterest = Convert.ToInt32(initalInterest + GetTemperaturePreference() + GetForcastPreference() + GetTastePreference(pitcherType) + GetPricePreference(lemonadeStand.PricePerCup)) + GetIcePreference(lemonadeStand.IcePerCup); int randomNumber = randomizer.Next(50, 85); return(randomNumber < overallInterest); }
public void start(ref LemonadeStand stand, String weatherState, int temperature) { List <String> peopleNames = new List <String> { "Joe", "Jimmy", "Jon", "Velda", "Colleen", "Borus", "Patrick", "Anna", "Joanne", "Upsilon", "Plato", "Socrates", "Earl", "Ingryd", "Ella", "Terryl" }; //preference according to weather int potentialCustomers = 0; int soldTo = 0; Random rnd = new Random(); // 10 waves of 3-10 people for (int i = 0; i < 10; i++) { //make a random amount of people appear here for (int j = 0; j < rnd.Next(3, 10); j++) { if (stand.checkPitcher()) { Person p = new Person(peopleNames); // how weather influences person if (weatherState == "Sunny") { p.influenceBuyChance(0.3); } if (weatherState == "Rainy") { p.influenceBuyChance(-0.3); } p.influenceBuyChance(stand.getPopularity()); p.influenceBuyChance(.25 - stand.getPrice()); p.influenceBuyChance(temperature / 65); if (p.makeDecision(ref stand)) { soldTo++; } } potentialCustomers++; } //people make a decision if they want to by here System.Threading.Thread.Sleep(2000); } //returns money made and popularity gained Console.Clear(); UI.writeLineAt($"You Sold to {soldTo} of {potentialCustomers} potential customers", stand.pos); }
public bool makeDecision(ref LemonadeStand L) { //decides if they want some lemonade Random rnd = new Random(); Func <bool> decision = () => { double n = rnd.Next(0, 100) * buyChance; if (n > 50) { return(true); } return(false); }; if (decision()) { //buyin some lemonade if (this.money > L.getPrice()) { double cost = L.sellTo(this); this.money -= cost; if (this.likes(L.getRecipe())) { UI.writeLineAt($"{this.name}: Like the lemonade", L.pos); L.incrementPopularity(); } else { UI.writeLineAt($"{this.name}: This lemonade is meh", L.pos); } return(true); } else { return(false); } } else { Console.WriteLine(); return(false); } }
static void Main(string[] args) { Console.WriteLine("How many stands do you want to open?"); int numberOfStands = int.Parse(Console.ReadLine()); for (int i = 1; i <= numberOfStands; i++) { LemonadeStand newStand = new LemonadeStand(); Console.WriteLine("What is the name of location " + i + "?"); newStand.Name = Console.ReadLine(); Console.WriteLine("How many cups will you sell in this location "); newStand.NumberOfCups = int.Parse(Console.ReadLine()); Console.WriteLine("What is the price in this location"); newStand.PricePerCup = decimal.Parse(Console.ReadLine()); Console.WriteLine("What is the cost in this location"); newStand.CostPerCup = decimal.Parse(Console.ReadLine()); Console.WriteLine("This stand's total revenue will be " + newStand.GetTotalRevenue()); Console.WriteLine("This stand's total expense will be " + newStand.GetTotalExpenses()); Console.WriteLine("This stand's total profit will be " + newStand.GetTotalProfit()); } for (int i = 1; i <= numberOfStands; i++) { LemonadeStandCorporation totalsOfStands = new LemonadeStandCorporation(); } Console.WriteLine("Total revenue"); LemonadeStandCorporation totals = new LemonadeStandCorporation(); Console.WriteLine("Total revenue is " + totals.GetTotalRevenueOfStands()); Console.WriteLine("Total profit is " + totals.GetTotalProfitOfStands()); Console.WriteLine("Total expense is " + totals.GetTotalExpensesOfStands()); Console.ReadLine(); }
static void Main(string[] args) { LemonadeStand stand = new LemonadeStand(); Console.WriteLine("What is the name of this lemonade stand?"); stand.Name = Console.ReadLine(); stand.TableCost = GetDecimalAnswerFromUser("How much will your table cost?"); stand.ChairCost = GetDecimalAnswerFromUser("How much will your chair cost?"); stand.SignCost = GetDecimalAnswerFromUser("How much will your sign cost?"); stand.LemonsCostPerCup = GetDecimalAnswerFromUser("How much will the lemon cost per cup?"); stand.SugarCostPerCup = GetDecimalAnswerFromUser("How much will the sugar cost per cup?"); stand.PricePerCup = GetDecimalAnswerFromUser("What will be the price of a cup?"); Console.WriteLine("How many cups will you sell?"); string numberOfCupsResponse = Console.ReadLine(); stand.NumberOfCupsSold = int.Parse(numberOfCupsResponse); decimal totalProfit = stand.GetTotalProfit(); Console.WriteLine("Your profit will be $" + totalProfit); }
static void Main(string[] args) { LemonadeStand stand = new LemonadeStand(); Console.WriteLine("How much does a cup cost to make?"); string costResponse = Console.ReadLine(); stand.CostPerCup = double.Parse(costResponse); Console.WriteLine("For how much will a cup be sold for?"); string priceResponse = Console.ReadLine(); stand.PricePerCup = double.Parse(priceResponse); Console.WriteLine("How many cups have been sold this season?"); string cupsSoldResponse = Console.ReadLine(); stand.CupsSoldPerSeason = int.Parse(cupsSoldResponse); Console.WriteLine($"Your revenue is: {stand.TotalRevenue()}"); Console.WriteLine($"Your expenses are: {stand.TotalExpenses()}"); Console.WriteLine($"Your current profit is: {stand.TotalProfit()}"); Console.ReadLine(); }
public Day(ref LemonadeStand stand) { }
static void Main(string[] args) { LemonadeStand inputInstance = new LemonadeStand(); Console.WriteLine("Welcome!"); int numberOfLemonadeStands = inputInstance.GetUserInegerInput("How many lemonade stands would you like to open?"); List <LemonadeStand> locations = new List <LemonadeStand>(); for (int i = 0; i < numberOfLemonadeStands; i++) { LemonadeStand lemonadeStand = new LemonadeStand(); Console.WriteLine("What is the name of location " + (i + 1) + "?"); lemonadeStand.name = Console.ReadLine(); lemonadeStand.numOfCups = lemonadeStand.GetUserInegerInput("How many cups will you sell?"); lemonadeStand.pricePerCup = lemonadeStand.GetUserDoubleInput("How much will you charge per cup?"); lemonadeStand.costPerCup = lemonadeStand.GetUserDoubleInput("How much will you spend on lemonade?"); Console.WriteLine(); Console.WriteLine("After calculating all of your inputs..."); Console.WriteLine(); Console.WriteLine(lemonadeStand.name + " sounds like a good name for this stand."); Console.WriteLine(); Console.WriteLine("If you are going to sell " + lemonadeStand.numOfCups + " cups of lemonade"); Console.WriteLine("and you are charging $" + lemonadeStand.pricePerCup + " "); Console.WriteLine("and it costs you $" + lemonadeStand.costPerCup + " per cup of lemonade."); Console.WriteLine(); Console.WriteLine("This stand's revenue will be $" + lemonadeStand.totalRevenue()); Console.WriteLine("This stand's expenses will be $" + lemonadeStand.totalExpenses()); Console.WriteLine("This stand's profit will be $" + lemonadeStand.totalProfit()); Console.WriteLine(); locations.Add(lemonadeStand); } PopsicleStand inputInstance1 = new PopsicleStand(); Console.WriteLine("Welcome!"); int numberOfPopsicleStands = inputInstance1.GetUserInegerInput("How many popsicle stands would you like to open?"); List <PopsicleStand> locations1 = new List <PopsicleStand>(); for (int i = 0; i < numberOfPopsicleStands; i++) { PopsicleStand popsicleStand = new PopsicleStand(); Console.WriteLine("What is the name of location " + (i + 1) + "?"); popsicleStand.name = Console.ReadLine(); popsicleStand.numOfPopsicles = popsicleStand.GetUserInegerInput("How many popsicles will you sell?"); popsicleStand.pricePerPopsicle = popsicleStand.GetUserDoubleInput("How much will you charge per popsicle?"); popsicleStand.costPerPopsicle = popsicleStand.GetUserDoubleInput("How much will you spend on the popsicles?"); Console.WriteLine(); Console.WriteLine("After calculating all of your inputs..."); Console.WriteLine(); Console.WriteLine(popsicleStand.name + " sounds like a good name for this stand."); Console.WriteLine(); Console.WriteLine("If you are going to sell " + popsicleStand.numOfPopsicles + " popsicles"); Console.WriteLine("and you are charging $" + popsicleStand.pricePerPopsicle + " "); Console.WriteLine("and it costs you $" + popsicleStand.costPerPopsicle + " per popsicle."); Console.WriteLine(); Console.WriteLine("This stand's revenue will be $" + popsicleStand.totalRevenue()); Console.WriteLine("This stand's expenses will be $" + popsicleStand.totalExpenses()); Console.WriteLine("This stand's profit will be $" + popsicleStand.totalProfit()); Console.WriteLine(); locations1.Add(popsicleStand); } Console.ReadLine(); }
public Player(LemonadeStand stand) { this.stand = stand; }
public Player() { this.stand = new LemonadeStand(new recipe(5, 5, 5)); }
//constructor public Player() { inventory = new Inventory(); wallet = new Wallet(); lemonadeStand = new LemonadeStand(); }
static void Main(string[] args) { //new stuff__________________________________________ LemonadeStand lemonadeStand = new LemonadeStand(); //_______________________________________________ Console.WriteLine("Hello !"); Console.WriteLine("Enter the name of your lemonade stand"); //string standName = Console.ReadLine(); lemonadeStand.Name = Console.ReadLine(); //************************ Console.WriteLine("Your Lem Stand will be named: " + lemonadeStand.Name); //************* Console.WriteLine("How many cups will you sell?"); // int numCups = Int32.Parse(Console.ReadLine()); lemonadeStand.NumbCups = Int32.Parse(Console.ReadLine()); //********* Console.WriteLine("How many Customers do you predict?"); int numCustomers = Int32.Parse(Console.ReadLine()); Console.WriteLine("How much will you sell each cup for?"); // int priceCups = Int32.Parse(Console.ReadLine()); lemonadeStand.PriceCups = decimal.Parse(Console.ReadLine());//*************** Console.WriteLine("How much will each cup cost to make? "); lemonadeStand.CostperCup = decimal.Parse(Console.ReadLine()); //*************** //___________________ decimal totalRevenue = lemonadeStand.NumbCups * lemonadeStand.PriceCups; decimal totalExpenses = lemonadeStand.NumbCups * lemonadeStand.CostperCup; decimal totalProfit = totalRevenue - totalExpenses; //__________________ // int totalRevenue = numCups * priceCups; Console.WriteLine("Your total revennue would be" + totalRevenue); Console.WriteLine("Your total expenses would be" + totalExpenses); Console.WriteLine("Your total expenses would be" + totalProfit); Console.ReadLine(); //_+________________________________________- LemonadeStand stand2 = new LemonadeStand(); stand2.Name = Console.ReadLine(); stand2.NumbCups = Int32.Parse(Console.ReadLine()); stand2.PriceCups = decimal.Parse(Console.ReadLine()); stand2.CostperCup = decimal.Parse(Console.ReadLine()); stand2.NumCostumers = Int32.Parse(Console.ReadLine()); decimal revenue2 = stand2.PriceCups * stand2.NumCostumers; decimal totalExpenses2 = stand2.NumbCups * stand2.CostperCup; decimal totalProfit2 = revenue2 - totalExpenses2; //________________________________3____________________________ LemonadeStand stand3 = new LemonadeStand(); stand3.Name = Console.ReadLine(); stand3.NumbCups = Int32.Parse(Console.ReadLine()); stand3.PriceCups = decimal.Parse(Console.ReadLine()); stand3.CostperCup = decimal.Parse(Console.ReadLine()); stand3.NumCostumers = Int32.Parse(Console.ReadLine()); decimal revenue3 = stand3.PriceCups * stand3.NumCostumers; decimal totalExpenses3 = stand3.NumbCups * stand3.CostperCup; decimal totalProfit3 = revenue2 - totalExpenses2; // LIST VERSION++++++++++++++++++++++++++++++++++++++++++++++++++++++++ List <LemonadeStand> locations = new List <LemonadeStand>(); for (int i = 0; i < 5; i++) //5 Locations { locations.Add(new LemonadeStand()); } foreach (LemonadeStand stand in locations) ///locations? { //properties_________ stand.Name = Console.ReadLine(); stand.NumbCups = Int32.Parse(Console.ReadLine()); stand.PriceCups = decimal.Parse(Console.ReadLine()); stand.CostperCup = decimal.Parse(Console.ReadLine()); stand.NumCostumers = Int32.Parse(Console.ReadLine()); decimal revenueALL = stand.PriceCups * stand.NumCostumers; decimal totalExpensesALL = stand.NumbCups * stand.CostperCup; decimal totalProfitALL = revenueALL - totalExpensesALL; } //+++++++++++++++++++++++++++++++= }