Exemplo n.º 1
0
        public static void AppendCustomerToLine()
        /// function that accepts a reference of the super market line, and append a customer to the line if it meets the requirements.
        /// if the customer join the line, a random shopping list is generated for him
        /// <input>
        /// by ValidatedID, ValidatedBodyHeat, IsMaskOn and ShouldBeIsolated methods on PersonHandler Class
        /// </input>
        /// <output>
        /// outputs by the GetInLine outputs in SuperMarketQueue class
        /// </output>
        {
            // start getting the information about the customer - ID, name, body heat, mask on, isolated
            Console.WriteLine("Please provide the following information");
            Console.Write("Enter customer`s full name: ");
            string   FullName = Console.ReadLine();
            string   cust_ID  = PersonHandler.ValidatedID();
            double   bh       = PersonHandler.ValidateBodyHeat();
            bool     mask     = PersonHandler.IsMaskOn();
            bool     isolate  = PersonHandler.ShouldBeIsolated();
            Customer c        = new Customer(FullName, cust_ID, bh, mask, isolate);

            GetInLine(c);
            if (mask && isolate == false && PersonHandler.IsSick(bh) == false)
            {
                CustomerHandler.GenerateRandomShoppingList(c);
            }
        }
Exemplo n.º 2
0
        public static bool IsEmployeeAllowedToWork(Employee emp)
        {
            double bh      = PersonHandler.ValidateBodyHeat();
            bool   mask    = PersonHandler.IsMaskOn();
            bool   isolate = PersonHandler.ShouldBeIsolated();

            return(mask && isolate == false && PersonHandler.IsSick(bh) == false);
        }