Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

please solve in python The following sensors and switch controls are installed in a smart room: OJECT SENSOR LIGHT SENSOR, DOOR SENSOR, PIR SENSOR TEMPERATURE

image text in transcribed

image text in transcribed

please solve in python

The following sensors and switch controls are installed in a smart room: OJECT SENSOR LIGHT SENSOR, DOOR SENSOR, PIR SENSOR TEMPERATURE SENSOR, DOOR CONTROL WINDOW CONTROL VOICE ASSISTANCE CONTROL, MUSIC SYSTEM CONTROL LIGHT CONTROL AIR CONDITION CONTROL and TELIVISION CONTROL The following flags represent the sensors and controls in the smart room application python program. The data type of these flags is string, OBIECT_SENSOR_ON OBJECT_SENSOR_OFF LIGHT_SENSOR_ON LIGHT_SENSOR_OFF DOOR_SENSOR_ON DOOR_SENSOR_OFF PIR_SENSOR ON PIR_SENSOR_OFF TEMPERATURE_SENSOR_ON TEMPERATURE SENSOR_OFF DOOR_OPEN_CONTROL_ON DOOR_CLOSE CONTROL ON WINDOW_OPEN_CONTROLLON WINDOW_CLOSE_CONTROLLON VOICE_ASSISTANCE_CONTROLLON VOICE_ASSISTANCE_CONTROL_OFF MUSIC_SYSTEM_CONTROLLON MUSIC_SYSTEM_CONTROL_OFF LIGHT_SWITCH_ON LIGHT_SWITCH_OFF AIRCONDITIONER_SWITCH ON AIRCONDITIONER SWITCH OFF TELIVISION_SWITCH_ON TELIVISION_SWITCH_OFF Write functions in python program for Turning ON/OFF the DOOR, MUSIC SYSTEM, LIGHT and AIR CONDITIONER appliances. The conditions for Turning ON/OFF the appliances are: 1. Conditions for Open the DOOR: OBJECT SENSOR should be ON. 2. Conditions for turn on the LIGHT: PIR SENSOR should be ON LIGHT SENSOR should be ON. Conditions for turn OFF the LIGHT: PIR SENSOR should be OFF, DOOR CLOSE CONTROL should be ON, WINDOW CLOSE CONTROL should be ON, LIGHT SENSOR may be ON or OFF. 3. Conditions for tum On the AIR CONDITIONER: PIR SENSOR should be ON, DOOR CLOSE CONTROL should be ON, WINDOW CLOSE CONTROL should be ON, TEMPERATURE SENSOR should be ON. Conditions for turn OFF the AIR CONDITIONER: PIR SENSOR should be OFF, DOOR CLOSE CONTROL may be ON or OFF, WINDOW CLOSE CONTROL may be ON or OFF, TEMPERATURE SENSOR should be OFF. 4. Conditions for turn OFF the VOICE CONTROL: PIR SENSOR should be OFF, DOOR CLOSE CONTROL should be ON, WINDOW CLOSE CONTROL should be ON. 5. Conditions for turn ON the MUSIC SYSTEM: PIR SENSOR should be ON, DOOR CLOSE CONTROL should be ON, WINDOW CLOSE CONTROL should be ON, LIGHT Page 1 of 3 382 words E English (United States) Accessibility: Unavailable and AIR CONDITIONER may be ON or OFF. Conditions for turn OFF the MUSIC SYSTEM: PIR SENSOR should be OFF, DOOR CLOSE CONTROL should be on, WINDOW CLOSE CONTROL should be ON. LIGHT and AIR CONDITIONER should be OFF. The above numerical order denotes the appliance. The outputs should be printed as follows: Door Turned ON Door Turned OFF Light Turned ON Light Turned OFF Air Conditioner Tumed ON Air Conditioner Tumed OFF Voice Control Turned ON Voice Control Turned OFF Music System Turned ON Music System Turned OFF Input: 5 Turn OFF Output: Doar Turned ON The following sensors and switch controls are installed in a smart room: OJECT SENSOR LIGHT SENSOR, DOOR SENSOR, PIR SENSOR TEMPERATURE SENSOR, DOOR CONTROL WINDOW CONTROL VOICE ASSISTANCE CONTROL, MUSIC SYSTEM CONTROL LIGHT CONTROL AIR CONDITION CONTROL and TELIVISION CONTROL The following flags represent the sensors and controls in the smart room application python program. The data type of these flags is string, OBIECT_SENSOR_ON OBJECT_SENSOR_OFF LIGHT_SENSOR_ON LIGHT_SENSOR_OFF DOOR_SENSOR_ON DOOR_SENSOR_OFF PIR_SENSOR ON PIR_SENSOR_OFF TEMPERATURE_SENSOR_ON TEMPERATURE SENSOR_OFF DOOR_OPEN_CONTROL_ON DOOR_CLOSE CONTROL ON WINDOW_OPEN_CONTROLLON WINDOW_CLOSE_CONTROLLON VOICE_ASSISTANCE_CONTROLLON VOICE_ASSISTANCE_CONTROL_OFF MUSIC_SYSTEM_CONTROLLON MUSIC_SYSTEM_CONTROL_OFF LIGHT_SWITCH_ON LIGHT_SWITCH_OFF AIRCONDITIONER_SWITCH ON AIRCONDITIONER SWITCH OFF TELIVISION_SWITCH_ON TELIVISION_SWITCH_OFF Write functions in python program for Turning ON/OFF the DOOR, MUSIC SYSTEM, LIGHT and AIR CONDITIONER appliances. The conditions for Turning ON/OFF the appliances are: 1. Conditions for Open the DOOR: OBJECT SENSOR should be ON. 2. Conditions for turn on the LIGHT: PIR SENSOR should be ON LIGHT SENSOR should be ON. Conditions for turn OFF the LIGHT: PIR SENSOR should be OFF, DOOR CLOSE CONTROL should be ON, WINDOW CLOSE CONTROL should be ON, LIGHT SENSOR may be ON or OFF. 3. Conditions for tum On the AIR CONDITIONER: PIR SENSOR should be ON, DOOR CLOSE CONTROL should be ON, WINDOW CLOSE CONTROL should be ON, TEMPERATURE SENSOR should be ON. Conditions for turn OFF the AIR CONDITIONER: PIR SENSOR should be OFF, DOOR CLOSE CONTROL may be ON or OFF, WINDOW CLOSE CONTROL may be ON or OFF, TEMPERATURE SENSOR should be OFF. 4. Conditions for turn OFF the VOICE CONTROL: PIR SENSOR should be OFF, DOOR CLOSE CONTROL should be ON, WINDOW CLOSE CONTROL should be ON. 5. Conditions for turn ON the MUSIC SYSTEM: PIR SENSOR should be ON, DOOR CLOSE CONTROL should be ON, WINDOW CLOSE CONTROL should be ON, LIGHT Page 1 of 3 382 words E English (United States) Accessibility: Unavailable and AIR CONDITIONER may be ON or OFF. Conditions for turn OFF the MUSIC SYSTEM: PIR SENSOR should be OFF, DOOR CLOSE CONTROL should be on, WINDOW CLOSE CONTROL should be ON. LIGHT and AIR CONDITIONER should be OFF. The above numerical order denotes the appliance. The outputs should be printed as follows: Door Turned ON Door Turned OFF Light Turned ON Light Turned OFF Air Conditioner Tumed ON Air Conditioner Tumed OFF Voice Control Turned ON Voice Control Turned OFF Music System Turned ON Music System Turned OFF Input: 5 Turn OFF Output: Doar Turned ON

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Database Design Application Development And Administration

Authors: Michael V. Mannino

4th Edition

0615231047, 978-0615231044

Students also viewed these Databases questions