static void Main(string[] args) { Console.ForegroundColor = ConsoleColor.White; Console.BackgroundColor = ConsoleColor.DarkMagenta; // makes a new instance of the Farm class called Trestlebridge Farm Trestlebridge = new Farm(); while (true) { DisplayBanner(); Console.WriteLine("1. Create Facility"); Console.WriteLine("2. Purchase Animals"); Console.WriteLine("3. Purchase Seeds"); Console.WriteLine("4. Display Farm Status"); Console.WriteLine("5. Exit"); Console.WriteLine(); Console.WriteLine("Choose a FARMS option"); Console.Write("> "); string option = Console.ReadLine(); if (option == "1") { DisplayBanner(); CreateFacility.CollectInput(Trestlebridge); } else if (option == "2") { DisplayBanner(); PurchaseStock.CollectInput(Trestlebridge); } else if (option == "3") { DisplayBanner(); PurchaseSeed.CollectInput(Trestlebridge); } else if (option == "4") { DisplayBanner(); Console.WriteLine(Trestlebridge); // calls the toString method on Trestlebridge Console.WriteLine("Press return key to go back to main menu."); Console.ReadLine(); } else if (option == "5" || option.ToLower() == "exit") { Console.WriteLine("Today is a great day for farming"); break; } else { Console.WriteLine($"Invalid option: {option}"); } } }
static void Main(string[] args) { Console.ForegroundColor = ConsoleColor.White; Console.BackgroundColor = ConsoleColor.DarkBlue; Farm Trestlebridge = new Farm(); while (true) { DisplayBanner(); Console.WriteLine("1. Create Facility"); Console.WriteLine("2. Purchase Animals"); Console.WriteLine("3. Purchase Seeds"); Console.WriteLine("4. Display Farm Status"); Console.WriteLine("5. Exit"); Console.WriteLine(); Console.WriteLine("Choose a FARMS option"); Console.Write("> "); string option = Console.ReadLine(); if (option == "1") { DisplayBanner(); CreateFacility.CollectInput(Trestlebridge); } else if (option == "2") { DisplayBanner(); PurchaseLivestock.CollectInput(Trestlebridge); } else if (option == "3") { DisplayBanner(); PurchaseSeed.CollectInput(Trestlebridge); } else if (option == "4") { DisplayBanner(); Console.WriteLine(Trestlebridge); Console.WriteLine("\n\n\n"); Console.WriteLine("Press return key to go back to main menu."); Console.ReadLine(); } else if (option == "5") { Console.WriteLine("Today is a great day for farming"); break; } else { Console.WriteLine($"Invalid option: {option}. Please try again."); Thread.Sleep(1000); } } }
static void Main(string[] args) { Console.ForegroundColor = ConsoleColor.White; Console.BackgroundColor = ConsoleColor.DarkMagenta; Farm Trestlebridge = new Farm(); while (true) { DisplayBanner(); Console.WriteLine(@"1. Create Facility"); Console.WriteLine(@"2. Purchase Animals"); Console.WriteLine(@"3. Purchase Seeds"); Console.WriteLine(@"4. Processing Options"); Console.WriteLine(@"5. Display Farm Status"); Console.WriteLine(@"6. Exit"); Console.WriteLine(); Console.WriteLine("Choose a FARMS option"); Console.Write("> "); int option = 0; while (option == 0) { try { option = Int32.Parse(Console.ReadLine()); switch (option) { case 1: DisplayBanner(); CreateFacility.CollectInput(Trestlebridge); break; case 2: DisplayBanner(); PurchaseStock.CollectInput(Trestlebridge); break; case 3: DisplayBanner(); PurchaseSeed.CollectInput(Trestlebridge); break; case 4: DisplayBanner(); Console.WriteLine("You've hit processing! There's nothing to do here yet... hit enter to return to the main menu."); Console.Read(); break; case 5: DisplayBanner(); Console.WriteLine(Trestlebridge); Console.WriteLine("\n\n\n"); Console.WriteLine("Press return key to go back to main menu."); Console.ReadLine(); break; case 6: Console.WriteLine("Today is a great day for farming!"); System.Environment.Exit(0); break; default: Console.WriteLine($"Invalid option: {option}. Press enter to return to the main menu."); Console.Read(); break; } } catch (FormatException) { Console.WriteLine("Please input a number!"); } } } }
// Main method to launch program. Also sets foreground color to white and background to dark blue, harkening a simpler more Commodore 64-esque era. static void Main(string[] args) { Console.ForegroundColor = ConsoleColor.White; Console.BackgroundColor = ConsoleColor.DarkBlue; // Creates Trestlebridge object Farm Trestlebridge = new Farm(); // While loop keeps user in FARMS program while (true) { // Displays banner and main menu options to user DisplayBanner(); Console.WriteLine("1. Create Facility"); Console.WriteLine("2. Purchase Animals"); Console.WriteLine("3. Purchase Seeds"); Console.WriteLine("4. Process Farm Products"); Console.WriteLine("5. Display Farm Status"); Console.WriteLine("6. Exit"); Console.WriteLine(); // Prompts user to select the number of the desired option Console.WriteLine("Choose a FARMS option"); Console.Write("> "); string option = Console.ReadLine(); // Reads user's input and presents the associated sub-menu for the chosen option if (option == "1") { DisplayBanner(); CreateFacility.CollectInput(Trestlebridge); } else if (option == "2") { DisplayBanner(); PurchaseStock.CollectInput(Trestlebridge); } else if (option == "3") { DisplayBanner(); PurchaseSeed.CollectInput(Trestlebridge); } else if (option == "4") { DisplayBanner(); ChooseProcessingOption.CollectInput(Trestlebridge); } else if (option == "5") { DisplayBanner(); Console.WriteLine(Trestlebridge); Console.WriteLine("\n\n\n"); Console.WriteLine("Press return key to go back to main menu."); Console.ReadLine(); } // Exits program and prints a warm departure message to the user else if (option == "6") { Console.WriteLine("Rest well. Tomorrow brings another day of plowing fields and ethically raising happy animals for farm-to-table restaurants all over Nashville."); break; } else { Console.WriteLine($"Invalid option: {option}"); } } }
static void Main(string[] args) { //color of the application //such an eyesore //who the hell though this was a good idea??? Console.ForegroundColor = ConsoleColor.White; Console.BackgroundColor = ConsoleColor.DarkMagenta; //instance of a new farm type Farm Trestlebridge = new Farm(); //main menu while (true) { DisplayBanner(); //list of options //added the option for processing options menu on option 5 //changed exit to option 6 Console.WriteLine("1. Create Facility"); Console.WriteLine("2. Purchase Animals"); Console.WriteLine("3. Purchase Seeds"); Console.WriteLine("4. Display Farm Status"); Console.WriteLine("5. Processing Options"); Console.WriteLine("6. Exit"); Console.WriteLine("Choose a FARMS option"); Console.Write("> "); string option = Console.ReadLine(); if (option == "1") { DisplayBanner(); CreateFacility.CollectInput(Trestlebridge); } else if (option == "2") { DisplayBanner(); PurchaseStock.CollectInput(Trestlebridge); } else if (option == "3") { DisplayBanner(); PurchaseSeed.CollectInput(Trestlebridge); } else if (option == "4") { DisplayBanner(); //Calls the ToString() function in Farm.cs. This sets off a cascade of calling multiple ToString() functions Console.WriteLine(Trestlebridge); Console.WriteLine("\n\n\n"); Console.WriteLine("Press return key to go back to main menu."); Console.ReadLine(); } //this will bring you to the processing options menu else if (option == "5") { //calls the display banner method DisplayBanner(); //calls the collect input method from ProcessingOptions.cs ProcessingOptions.CollectInput(); } else if (option == "6") { Console.WriteLine("Today is a great day for farming"); break; } else { //this will tell you that whatever key you hit was invalid Console.WriteLine($"Invalid option: {option}"); //this pauses the error message Thread.Sleep(2000); } } }
static void Main(string[] args) { Console.ForegroundColor = ConsoleColor.White; Console.BackgroundColor = ConsoleColor.DarkCyan; Farm Trestlebridge = new Farm(); while (true) { DisplayBanner(); Console.WriteLine("1. Create Facility"); Console.WriteLine("2. Purchase Animals"); Console.WriteLine("3. Purchase Seeds"); Console.WriteLine("4. Display Farm Status"); Console.WriteLine("5. Exit"); Console.WriteLine(); Console.WriteLine("Choose a FARMS option"); Console.Write("> "); string option = Console.ReadLine(); if (option == "1") { DisplayBanner(); CreateFacility.CollectInput(Trestlebridge); } else if (option == "2") { DisplayBanner(); PurchaseStock.CollectInput(Trestlebridge); } else if (option == "3") { DisplayBanner(); PurchaseSeed.CollectInput(Trestlebridge); } else if (option == "4") { DisplayBanner(); Console.WriteLine(Trestlebridge); Console.WriteLine("\n\n\n"); Console.WriteLine("Press return key to go back to main menu."); Console.ReadLine(); } else if (option == "5") { Console.Clear(); Console.WriteLine("\n\n\n"); Console.WriteLine("Today is a great day for farming. May you drown in the great Kraken's infinite love."); Console.WriteLine(@" 7... 7 77.......7 7........... .............7 I...............:7 ................. 777 ...............7 7 7.I~.7 7...........7 7.~7.7 77 ., ........... ,. .7 ........... 7.7 ..7 ........... .. 7.7 ........... 7. 7=. ........... 7.. .. 7 7:........ 7.. I...~..7 .,......, 7..:..., 7...77 7. +......., . 7...7 :. ...77 7 I.........I7 777...7., .. 7~.........................~7 .. 7.77 777++7......7......7?=77 7.7 7..7 7........7........ 7..+ ?......7+..7..7..7..+7......? 7+.., .. ..77..+7 7=... 7.. .. 7.... ..+.. ..7..7 ,.+..7 7..I~.7 7..7..7 7.~7..7 7... ..7 +.? ?.= 7.. ...7 I..+ ,.7 .. .. 7.,7 77..I ..77 I.7 .. .. 7.I 7..7 ,.7 7.: .. 7..7:. 7.. 7.=7 7.7~.77.... .... 7.:7. 7.7 7. .? ... ...7 7.7 7.7 7.77 7.7 ..7 .. 77. 7.7 ..7 77.. ..7 7..7 ..7 7.. :.....77 ~.?. .7.: 7......7 ..77 777.. :.7 7.: 7.7 7.7 .: 7.7 .. ..7 7.7 .7 .7 77.7 . 7.7 7,7 7.7 .7 . GlassGiant.com "); break; } else { Console.Clear(); Console.WriteLine("\n\n\n"); Console.WriteLine("Welcome to timeout."); Console.WriteLine("Your mom and I are very disappointed."); Console.WriteLine(); Console.WriteLine($"Invalid option: {option}"); Console.ReadLine(); } } }