Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Java Programming Question: You are asked to create a smart home system for collecting two sensor data from a thermometer and a hygrometer. Both sensor

Java Programming Question:

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:

image text in transcribed

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

\begin{tabular}{|l|} \hline \multicolumn{2}{|c|}{ interface> Listener } \\ \hline -update() \\ \hline \end{tabular} \begin{tabular}{|l|} \hline \multicolumn{2}{|c|}{ Hygrometer } \\ \hline -Listener \\ \hline +registerListener()+run() \\ \hline \end{tabular} \begin{tabular}{|l|} \hline \multicolumn{1}{|c|}{ Thermometer } \\ \hline -Listener \\ \hline +registerListener()+run() \\ \hline \end{tabular}

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_2

Step: 3

blur-text-image_3

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

Expert Performance Indexing In SQL Server

Authors: Jason Strate, Grant Fritchey

2nd Edition

1484211189, 9781484211182

More Books

Students also viewed these Databases questions

Question

c. 120 marksl efficiency tr*le-off by intellectual property rights.

Answered: 1 week ago

Question

4. What sales experience have you had?

Answered: 1 week ago

Question

15-5 How will MIS help my career?

Answered: 1 week ago