Exemplo n.º 1
0
        public void Display()
        {
            try
            {
                Coffee        coffee = new Coffee();
                DailySales    sales  = new DailySales();
                EmployeeHours hours  = new EmployeeHours();

                Console.WriteLine("Select an option");
                Console.WriteLine("(1) for coffee sales, (2) for Sandwich Sales, (3) Employee Hours ");

                string input = Console.ReadLine();

                switch (input)
                {
                case "1":
                    coffee.Coffeesales();
                    break;

                case "2":
                    sales.SandwichSales();
                    break;

                case "3":
                    hours.Hours();
                    break;
                }
            }
            catch (Exception)
            {
                Console.WriteLine("Fill in information correctly");
                Console.ReadLine();
                Display();
            }
        }
Exemplo n.º 2
0
        public void Menu()
        {
            string userSelection = "0";

            while (userSelection != "3")
            {
                Console.Clear();
                DailySales    ds  = new DailySales();
                WeeklyPayRoll wpr = new WeeklyPayRoll();

                Console.WriteLine($"Welcome!");
                Console.WriteLine($"select (1) to calculate youur daily sales.");
                Console.WriteLine($"Select (2) to calculate weekly payroll.");
                Console.WriteLine($"Or select (3) to exit");
                userSelection = Console.ReadLine();

                switch (userSelection)
                {
                case "1":
                    ds.Sales();
                    break;

                case "2":
                    wpr.PayRoll();
                    break;

                case "3":
                    Console.WriteLine($"Thank you, have a nice day!");
                    Console.ReadLine();
                    break;
                }
            }
        }
Exemplo n.º 3
0
        public void Sales()
        {
            try
            {
                double a;
                double b;
                double c;
                double d;
                double e;

                Console.WriteLine($"How many small coffess were sold?");
                a = Convert.ToDouble(Console.ReadLine());
                Console.WriteLine($"How many meduim coffess were sold?");
                b = Convert.ToDouble(Console.ReadLine());
                Console.WriteLine($"How many large coffess were sold?");
                c = Convert.ToDouble(Console.ReadLine());
                Console.WriteLine($"How many egg sandwiches were sold?");
                d = Convert.ToDouble(Console.ReadLine());
                Console.WriteLine($"How many checken biscuits were sold?");
                e = Convert.ToDouble(Console.ReadLine());
                Console.WriteLine($"The total sales for today is: ${((sales.smallCoffee * a) - (a * sales.CostSC)) + ((sales.meduimCoffee * b) - (b * sales.CostMC)) + ((sales.largeCoffee * c) - (c * sales.CostLC)) + ((sales.Eggs * d) - (sales.CostE * d)) + ((sales.Chick * e) - (sales.CostC * e)) }");
                Console.ReadLine();
            } catch (Exception)
            {
                Console.WriteLine($"Please input a valid value.");
                DailySales ds = new DailySales();
                ds.Sales();
            }
        }