Write a code in Java programming: You are asked to create a smart home system for collecting two sensor data from a thermometer and a hygrometer. Both sensor data should continuously show on a monitor. The data collecting frequency for the thermometer is about 1 second, and the frequency for the hygrometer is about 2 seconds. In addition, the data range for a thermometer is between 0 to 45 degrees, and the data range for a hygrometer is between 0 to 100%. Both sensors should run forever unless the user shuts down the system. You should implement this system according to the design below: Please check below for a sample output when the system is activated. You must follow the system design and have the same printing format in order to receive full marks. [Thermometer]:5 degree [Hygrometer]:84% [Thermometer]:9 degree [Thermometer]:21 degree [Hygrometer]:57% [Thermometer]:15 degree [Thermometer]:14 degree [Hygrometer]:96% [Thermometer]:29 degree [Thermometer]:6 degree [Hygrometer]:22% [Thermometer]:0 degree [Thermometer]:17 degree [Hygrometer]:4% [Thermometer]:33 degree [Thermometer]:10 degree [Hygrometer]:59% [Thermometer]:8 degree [Thermometer]:12 degree [Hygrometer]:75% [Thermometer]:18 degree [Thermometer]:11 degree [Hygrometer]:49% [Thermometer]:27 degree [Thermometer]:18 degree [Hygrometer]:76% [Thermometer]:22 degree [Thermometer]:44 degree [Hygrometer]:73% [Thermometer]:36 degree

Database System Concepts
7th Edition
ISBN:9780078022159
Author:Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Publisher:Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Chapter1: Introduction
Section: Chapter Questions
Problem 1PE
icon
Related questions
Question

Write a code in Java programming:

You are asked to create a smart home system for collecting two sensor data from a thermometer and a hygrometer. Both sensor data should continuously show on a monitor.

The data collecting frequency for the thermometer is about 1 second, and the frequency for the hygrometer is about 2 seconds. In addition, the data range for a thermometer is between 0 to 45 degrees, and the data range for a hygrometer is between 0 to 100%.

Both sensors should run forever unless the user shuts down the system.

You should implement this system according to the design below:

Please check below for a sample output when the system is activated. You must follow the system design and have the same printing format in order to receive full marks.

[Thermometer]:5 degree

[Hygrometer]:84%

[Thermometer]:9 degree

[Thermometer]:21 degree

[Hygrometer]:57%

[Thermometer]:15 degree

[Thermometer]:14 degree

[Hygrometer]:96%

[Thermometer]:29 degree

[Thermometer]:6 degree

[Hygrometer]:22%

[Thermometer]:0 degree

[Thermometer]:17 degree

[Hygrometer]:4%

[Thermometer]:33 degree

[Thermometer]:10 degree

[Hygrometer]:59%

[Thermometer]:8 degree

[Thermometer]:12 degree

[Hygrometer]:75%

[Thermometer]:18 degree

[Thermometer]:11 degree

[Hygrometer]:49%

[Thermometer]:27 degree

[Thermometer]:18 degree

[Hygrometer]:76%

[Thermometer]:22 degree

[Thermometer]:44 degree

[Hygrometer]:73%

[Thermometer]:36 degree

<<Interface>> Listener
-update()
implements
A
Monitor
+update()
^
update
update-
implements
-Listener
Thermometer
+run()
+registerListener()
creates
<<Interface>> Runnable
+run()
Main
+main()
implements
Hygrometer
-Listener
+registerListener()
+run()
Transcribed Image Text:<<Interface>> Listener -update() implements A Monitor +update() ^ update update- implements -Listener Thermometer +run() +registerListener() creates <<Interface>> Runnable +run() Main +main() implements Hygrometer -Listener +registerListener() +run()
Expert Solution
trending now

Trending now

This is a popular solution!

steps

Step by step

Solved in 4 steps with 3 images

Blurred answer
Knowledge Booster
Constants and Variables
Learn more about
Need a deep-dive on the concept behind this application? Look no further. Learn more about this topic, computer-science and related others by exploring similar questions and additional content below.
Similar questions
Recommended textbooks for you
Database System Concepts
Database System Concepts
Computer Science
ISBN:
9780078022159
Author:
Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Publisher:
McGraw-Hill Education
Starting Out with Python (4th Edition)
Starting Out with Python (4th Edition)
Computer Science
ISBN:
9780134444321
Author:
Tony Gaddis
Publisher:
PEARSON
Digital Fundamentals (11th Edition)
Digital Fundamentals (11th Edition)
Computer Science
ISBN:
9780132737968
Author:
Thomas L. Floyd
Publisher:
PEARSON
C How to Program (8th Edition)
C How to Program (8th Edition)
Computer Science
ISBN:
9780133976892
Author:
Paul J. Deitel, Harvey Deitel
Publisher:
PEARSON
Database Systems: Design, Implementation, & Manag…
Database Systems: Design, Implementation, & Manag…
Computer Science
ISBN:
9781337627900
Author:
Carlos Coronel, Steven Morris
Publisher:
Cengage Learning
Programmable Logic Controllers
Programmable Logic Controllers
Computer Science
ISBN:
9780073373843
Author:
Frank D. Petruzella
Publisher:
McGraw-Hill Education