Пример #1
0
        public void CoinSound()
        {
            test.AddMoney(2.0M);

            Change change = test.GetChange();

            change.ChangeSound();
        }
Пример #2
0
        private static void TransactionCompletedGiveChangeMenu()
        {
            Change change      = machine.GetChange();
            string totalChange = "Total Change: " + change.TotalChange.ToString();
            string quarters    = "Quarter(s):" + change.Quarters.ToString();
            string dimes       = "Dime(s):" + change.Dimes.ToString();
            string nickels     = "Nickel(s):" + change.Nickels.ToString();

            machine.UpdateSalesReport(machine.Inventory);

            string[] menu = { totalChange, "---------------------------------------", quarters, dimes, nickels };
            CircusOf();
            PrintMenus(menu);
            Value();

            foreach (var item in machine.ShoppingCart)
            {
                if (item.SlotID.Contains("A"))
                {
                    PrintMenus(new string[] { $"You are crunching on {item.NameOfItem} {item.ItemYumYum()}" });
                }
                else if (item.SlotID.Contains("B"))
                {
                    PrintMenus(new string[] { $"You are munching on {item.NameOfItem} {item.ItemYumYum()}" });
                }
                else if (item.SlotID.Contains("C"))
                {
                    PrintMenus(new string[] { $"You are drinking {item.NameOfItem} {item.ItemYumYum()}" });
                }
                else
                {
                    PrintMenus(new string[] { $"You are chewing on {item.NameOfItem} {item.ItemYumYum()}" });
                }
            }

            while (machine.ShoppingCart.Count > 0)
            {
                machine.PrintLog($"{machine.ShoppingCart[0].NameOfItem}" +
                                 $" {machine.ShoppingCart[0].SlotID}" +
                                 $" ${machine.CurrentMoneyProvided}" +
                                 $" ${(machine.CurrentMoneyProvided - machine.ShoppingCart[0].PriceOfItem)}");
                machine.PayForItem(machine.ShoppingCart[0]);
                machine.RemoveItemsFromCart(machine.ShoppingCart[0]);
            }


            machine.CalculateTotalShoppingCart(machine.ShoppingCart);

            machine.ResetCurrentMoneyProvided();

            machine.PrintLog($"GIVE CHANGE: ${change.TotalChange}    ${machine.CurrentMoneyProvided:0.00}");

            Console.WriteLine();
            Console.Clear();

            while (true)
            {
                CircusOf();
                string[] menu2 = { "(1) Return To Main Menu", "(2) Close Vending Machine" };
                PrintMenusSingleSpaced(menu2);
                Value();

                if (soundsOFF == false)
                {
                    change.ChangeSound();
                }

                string menuChoice = Console.ReadLine();

                if (menuChoice.ToUpper() == "1" || menuChoice.ToUpper() == "RETURN" || menuChoice.ToUpper() == "R")
                {
                    Console.Clear();
                    TopMenu();
                }
                else if (menuChoice.ToUpper() == "2" || menuChoice.ToUpper() == "CLOSE" || menuChoice.ToUpper() == "C")
                {
                    Environment.Exit(0);
                }
                else
                {
                    Console.Clear();
                    PrintMenus(new string[] { "That Is Not A Valid Choice, Please Enter (1) Or (2)" });
                }
            }
        }