Academic Integrity: tutoring, explanations, and feedback — we don’t complete graded work or submit on a student’s behalf.

Make a list of all the functions/objects/relationships/classes needed to fulfill

ID: 3706653 • Letter: M

Question

Make a list of all the functions/objects/relationships/classes needed to fulfill the project below.

We are coding in C++, so format all functions/objects/classes accordingly.

"A C++ code that will help communities by collecting data from the environment, weather and users. This will help us make street lights smarter by knowing times, days and instances when the lights should be on or off, ect"

Some more things that could make them smarter will be like, turning on during certain hours of the day. Turning one the lights, during the rain, ect.

Explanation / Answer

First of all congratulations on making effort for helping the community.

One thing I would like to point out is not everyone's approach to coding is the same. Some like to start with everything planned as it seems to be the case with your project and some like to start by developing small portions of the project to getting it completed.

There is no perfect way to approach these kinds of problems because you the coders have to decide whether to choose the functional programming approach of object-oriented approach and again it may be clear with time as you delve into code more & more.

For now, I would suggest you sample some data on your own and use the proximate results to develop the functions with values that you think will not deviate much.

As for the coding part, you might need functions such as

calculate_time_intervals() - the slicing of 24-hour daytime in accordance with the usual sunrise & sunset timings.

set_lamp_brightness() - set various brightness values to different time slices.

calc_new_results() - a function supplied with new data every day that calculates the new average values.

on_off_switch() - with the newly calculated values timings of switching the lamp on or off will change until it reaches a saturation state when values don't change much.

daylight_savings_management() - for summer days in various places it might be needed.

fault_alert() - if the lamp does not switch states as expected should alert the maintainers.

prediction_helpers() - make use of weather forecast to save light on a sunny day.

To make use of classes it is important that you make instances of the class so that each instance refers to a lamp and this way updates in functioning should make it available to every lamp.

Hope this answer can help you in some way possible.

Hire Me For All Your Tutoring Needs
Integrity-first tutoring: clear explanations, guidance, and feedback.
Drop an Email at
drjack9650@gmail.com
Chat Now And Get Quote