You are creating a phone app to display current weather information. which follo
ID: 3698406 • Letter: Y
Question
You are creating a phone app to display current weather information. which follows the Observer design pattern. To extend that functionality, you will have to do the following (check all that apply):
a. Create the class as “class DisplayPhone : public Weather”
b. Create the class as “class DisplayPhone : public Observer"
c. Create the class as “class DisplayPhone”
d. Register the DisplayPhone class with the Weather class.
e. Modify the Weather class to add an instance of DisplayPhone for notification.
Explanation / Answer
Answer :
A: False , as display phone object will be used by both the classes to display value.
B: False , as display phone object will be used by both the classes to display value.
C: True , display phone class will be created standalone, and objects of the other classes will be used from this class.
D: False, no need to register as object of both the weather and observer class will be called from the displayphone class.
E: True , calling displayphone object from the weather class to diplay the weather.
I have answered your question. Please do not forget to give a positive feedback to the answer. Thank you.
Related Questions
drjack9650@gmail.com
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.