public void VegetableOptions()
        {
            Console.Clear();
            Console.WriteLine("What kind of vegetable would you like to buy?");
            Console.WriteLine();
            Console.WriteLine("Cucumber $3");
            Console.WriteLine("Asparagus $3");
            Console.WriteLine("Carrot $1");
            Console.WriteLine("Bell Pepper $2");
            string fruitChoice = Console.ReadLine();

            if (fruitChoice == "Cucumber")
            {
                Console.Clear();
                Console.WriteLine("How many would you like?");
                string amount = Console.ReadLine();
                var    total  = new TotalCost();
                var    total2 = total.Calculate(fruitChoice, Convert.ToInt32(amount));
                Console.WriteLine("Your total is: $" + total2);
                Console.ReadLine();
            }
            else if (fruitChoice == "Asparagus")
            {
                Console.Clear();
                Console.WriteLine("How many would you like?");
                string amount = Console.ReadLine();
                var    total  = new TotalCost();
                var    total2 = total.Calculate(fruitChoice, Convert.ToInt32(amount));
                Console.WriteLine("Your total is: $" + total2);
                Console.ReadLine();
            }
            else if (fruitChoice == "Carrot")
            {
                Console.Clear();
                Console.WriteLine("How many would you like?");
                string amount = Console.ReadLine();
                var    total  = new TotalCost();
                var    total2 = total.Calculate(fruitChoice, Convert.ToInt32(amount));
                Console.WriteLine("Your total is: $" + total2);
                Console.ReadLine();
            }
            else if (fruitChoice == "Bell Pepper")
            {
                Console.Clear();
                Console.WriteLine("How many would you like?");
                string amount = Console.ReadLine();
                var    total  = new TotalCost();
                var    total2 = total.Calculate(fruitChoice, Convert.ToInt32(amount));
                Console.WriteLine("Your total is: $" + total2);
                Console.ReadLine();
            }
            else
            {
                Console.Clear();
                Console.WriteLine("Error: Please check item name spelling, and try again.");
                // Create a way to return to beginning of fruit prompt
            }
        }
Example #2
0
        public void FruitOptions()
        {
            Console.Clear();
            Console.WriteLine("What kind of fruit would you like to buy?");
            Console.WriteLine();
            Console.WriteLine("Watermelon $6");
            Console.WriteLine("Nectarine $5");
            Console.WriteLine("Loquat $2");
            Console.WriteLine("Asian Apple $3");
            string fruitChoice = Console.ReadLine();

            if (fruitChoice == "Watermelon")
            {
                Console.Clear();
                Console.WriteLine("How many would you like?");
                string amount = Console.ReadLine();
                var    total  = new TotalCost();
                var    total2 = total.Calculate(fruitChoice, Convert.ToInt32(amount));
                Console.WriteLine("Your total is: $" + total2);
                Console.ReadLine();
            }
            else if (fruitChoice == "Nectarine")
            {
                Console.Clear();
                Console.WriteLine("How many would you like?");
                string amount = Console.ReadLine();
                var    total  = new TotalCost();
                var    total2 = total.Calculate(fruitChoice, Convert.ToInt32(amount));
                Console.WriteLine("Your total is: $" + total2);
                Console.ReadLine();
            }
            else if (fruitChoice == "Loquat")
            {
                Console.Clear();
                Console.WriteLine("How many would you like?");
                string amount = Console.ReadLine();
                var    total  = new TotalCost();
                var    total2 = total.Calculate(fruitChoice, Convert.ToInt32(amount));
                Console.WriteLine("Your total is: $" + total2);
                Console.ReadLine();
            }
            else if (fruitChoice == "Asian Apple")
            {
                Console.Clear();
                Console.WriteLine("How many would you like?");
                string amount = Console.ReadLine();
                var    total  = new TotalCost();
                var    total2 = total.Calculate(fruitChoice, Convert.ToInt32(amount));
                Console.WriteLine("Your total is: $" + total2);
                Console.ReadLine();
            }
            else
            {
                Console.Clear();
                Console.WriteLine("Error: Please check item name spelling, and try again.");
                // Create a way to return to beginning of fruit prompt
            }
        }
Example #3
0
        public void TreeOptions()
        {
            Console.Clear();
            Console.WriteLine("What kind of plant would you like to buy?");
            Console.WriteLine();
            Console.WriteLine("Loquat Tree $50");
            Console.WriteLine("Nectarine Tree $45");
            Console.WriteLine("Lemon Tree $30");
            Console.WriteLine("Rose Bush $15");
            string treeChoice = Console.ReadLine();

            if (treeChoice == "Loquat Tree")
            {
                Console.Clear();
                Console.WriteLine("How many would you like?");
                string amount = Console.ReadLine();
                var    total  = new TotalCost();
                var    total2 = total.Calculate(treeChoice, Convert.ToInt32(amount));
                Console.WriteLine("Your total is: $" + total2);
                Console.ReadLine();
            }
            else if (treeChoice == "Nectarine Tree")
            {
                Console.Clear();
                Console.WriteLine("How many would you like?");
                string amount = Console.ReadLine();
                var    total  = new TotalCost();
                var    total2 = total.Calculate(treeChoice, Convert.ToInt32(amount));
                Console.WriteLine("Your total is: $" + total2);
                Console.ReadLine();
            }
            else if (treeChoice == "Lemon Tree")
            {
                Console.Clear();
                Console.WriteLine("How many would you like?");
                string amount = Console.ReadLine();
                var    total  = new TotalCost();
                var    total2 = total.Calculate(treeChoice, Convert.ToInt32(amount));
                Console.WriteLine("Your total is: $" + total2);
                Console.ReadLine();
            }
            else if (treeChoice == "Rose Bush")
            {
                Console.Clear();
                Console.WriteLine("How many would you like?");
                string amount = Console.ReadLine();
                var    total  = new TotalCost();
                var    total2 = total.Calculate(treeChoice, Convert.ToInt32(amount));
                Console.WriteLine("Your total is: $" + total2);
                Console.ReadLine();
            }
            else
            {
                Console.Clear();
                Console.WriteLine("Error: Please check item name spelling, and try again.");
                // Create a way to return to beginning of fruit prompt
            }
        }