Question

In: Computer Science

Design a system to automatically check temperature and facial mask use of a customer, dispense hand...

Design a system to automatically check temperature and facial mask use of a customer, dispense hand sanitiser and unlock the door if these conditions are satisfied, and sanitize the door handle after a customer enters or exits the building. Provide programming codes in a python language

Solutions

Expert Solution

Program written using Google Colab

Code:

import random # Imports random library
import time # Imports time library

for i in range(5): # Loop for 5 customers (Can be increased according to requirement)
  action = random.choice(('Enter', 'Exit')) # Randomly chooses if the customer is entering or exiting the door

  if action == 'Enter': # If the customer is trying to enter the door
    print("Customer approaching the door to enter...") # Prints the arrival of the customer
    time.sleep(3) # Sleep time to make it more realistic (Can be removed if not required)
    print("Checking Temperature...") # Prints that it is checking temperature
    temp = random.choices(range(95,104)) # Randomly chooses the temperature of the customer 
    time.sleep(3) # Sleep time to make it more realistic (Can be removed if not required)
    print("Checking if the customer has mask on...") # Prints that the system is checking if the customer has mask on
    mask = random.choices(('Yes', 'No'), (0.7, 0.3)) # Randomly chooses if the customer has mask on (Have inserted probability to make it more realistic)
    time.sleep(3) # Sleep time to make it more realistic (Can be removed if not required)

    if int(temp[0]) < 100 and mask == ['Yes']: # If the customers temperature is below 100 and has mask on
      print(f"Customer's temperature is Normal [{int(temp[0])}°F] and He/She is wearing a mask") # Prints that the customers temp is normal and has mask on
      print("Despensing Sanitizer and opening door...") # Prints that the system is now dispensing sanitizer and opening door
      time.sleep(5) # Sleep time to make it more realistic (Can be removed if not required)
      print("Customer has entered through the door. Doors locked...") # Prints that the customer has entered the door and the doors are now locking
      print("Santitizing door handles...") # Prints that the system is sanitizing the doors
    elif int(temp[0]) > 100 and mask == ['Yes']: # If the customers temperature is above 100 and has mask on
      print(f"Customer's Temperature is above Normal [{int(temp[0])}°F]. Customer not allowed to enter through the door") # Prints that the customers temp is above normal and has mask on
    elif int(temp[0]) > 100 and mask == ['No']: # If the customers temperature is above 100 and has no mask
      print(f"Customer's Temperature is above Normal [{int(temp[0])}°F]. Customer not allowed to enter through the door") # Prints that the customers temp is above normal and has no mask
    elif int(temp[0]) < 100 and mask == ['No']: # If the customers temperature is below 100 and has no mask
      print(f"Customer's temperature is Normal [{int(temp[0])}°F], but He/She is not wearing a mask. Customer not allowed to enter through the door") # Prints that the customers temp is normal and has no mask

  elif action == 'Exit': # If the customer is trying to exit the door
    print("Customer is approaching door to exit...") # Prints the departure of the customer
    time.sleep(3) # Sleep time to make it more realistic (Can be removed if not required)
    print("Opening door...") # Prints that the system is opening door
    time.sleep(3) # Sleep time to make it more realistic (Can be removed if not required)
    print("Santitizing door handles...") # Prints that the system is sanitizing the doors
  print("") # Blank line
  print("-----------------------------------------------------------------") # Customer sepeartor lines
  print("") # Blank line

Output:


Related Solutions

Most errors are discovered automatically through proper use of the double-entry system or by the internal...
Most errors are discovered automatically through proper use of the double-entry system or by the internal or external auditors. However, some errors escape detection until after they have been included in the published financial statements of a company. Required: Describe three types of errors that occur in financial statements and indicate the appropriate corrective action to take when the errors are discovered.
In regards to modern operating systems If you are asked to design a hotel check-in system...
In regards to modern operating systems If you are asked to design a hotel check-in system that has three steps, what would you like to propose? If you are asked to detail your previous design so that it has five steps, how would you update it and why? If you are asked to propose a hotel check-in system without any limitation in steps, what would it be and why?
Assume that you need to design a system that maintains a record of your body temperature...
Assume that you need to design a system that maintains a record of your body temperature measurements taken at different times to track fever etc. The system may include one or more parts/subsystems. Question1: What would be the major components of your designed system ? Explain them briefly. You may also draw a diagram illustrating the form factor of your components as you’ll design them
Assume that you need to design a system that maintains a record of your body temperature...
Assume that you need to design a system that maintains a record of your body temperature measurements taken at different times to track fever etc. The system may include one or more parts/subsystems. Question1: What would be the major components of your designed system ? Explain them briefly. You may also draw a diagram illustrating the form factor of your components as you’ll design them Question2: One of the most important part of the design process is estimating the mental...
In a Toy renting information system, the use case “Hand over Toy” is described in the...
In a Toy renting information system, the use case “Hand over Toy” is described in the following template. Use Case: Pickup Toy    Normal Flow: 1.Customer enters the office to ask for the toy to take away.     2.Service Staff retrieves the booking record   3.Service Staff shows the Toy to the customer   4. Service Staff records credit card information if not in the system yet. Validate the credit card for security 5.Service Staff stipulates the contract for the hire and the return...
At least 300 words. Our system will use turn it in to check the work, so...
At least 300 words. Our system will use turn it in to check the work, so please make sure to use your own words. please do not use handwriting, I always have trouble to read the handwriting Discuss 5 factors that have influenced the increasing development of resistant microbial strains
At least 300 words. Our system will use turn it in to check the work, so...
At least 300 words. Our system will use turn it in to check the work, so please make sure to use your own words. please do not use handwriting, I always have trouble to read the handwriting Create a list of 10 topics you can talk about in a TED-style like talk of 5 minutes or less. These could be lessons you've learned in your career or interests you've curated as you experience life. Share the list below in a...
What are the steps managers use to design a control system for their firm?
What are the steps managers use to design a control system for their firm?
what is the advantages to use PID controller in control system design ?
what is the advantages to use PID controller in control system design ?
System Design. UC1: Identify Equation (Use case 1) Preconditions • System is waiting for a question...
System Design. UC1: Identify Equation (Use case 1) Preconditions • System is waiting for a question Postconditions • An equation has been identified Basic Flow 1. System prompts the user for a question 2. User enters a question. 3. System analyses the question and identifies object and desired result. 4. System identifies the relevant equation. Alternate Flows 2a) User requests help 2a.1) System displays help text about objects and questions that can be handled, and resumes from step 1 3a)...
ADVERTISEMENT
ADVERTISEMENT
ADVERTISEMENT