In: Computer Science
Create a high-level design for a home alarm system. Assume that
there are 4 windows and 2 doors. The windows and doors have light
sensors, so if any object crosses the light path, an appropriate
event will be registered. Also, each window and door has latches
with sensors that detect if the latch has been turned.
Your solution will consist of the following
parts
1. Use a
variable “Armed” to allow a user to arm the alarm system. So if a
user is at home, the alarm is disarmed.
2. Create
appropriate variables that will capture the state of the windows
and doors. (2 points)
3. Create a
flowchart that will process the sensed input. (2 points)
4. Design the
right output. (2 points)
5. Create a
mechanism to reset the alarm. (1 point)
6. Write
pseudo-code (e.g. code that looks like C), using any functions you
may create.
1. We will use Armed variable as 1 or 0, 1- Activated & 0- Deactivated.
2. Following are the variables we will be using to represent the status of latches and the Light sensors if particular doors and windows.
All the variables used are of type enumeration that is they can only take specified values 1 or 0.
Entity | Latch Variable | Light Sensor |
Door1 | D_Latch1 | D_Ls1 |
Door2 | D_Latch2 | D_Ls2 |
Window1 | W_Latch1 | W_Ls1 |
Window2 | W_Latch2 | W_Ls2 |
Window3 | W_Latch3 | W_Ls3 |
Window4 | W_Latch4 | W_Ls4 |
The Following is the flowchart
In the output we will print the name of the window or the door where an unappropriate activity is happened, that is the light sensor is being cut.
The Pseudocode can be given as: