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

Please write function/object/classes/prototype names that would be used in this

ID: 3706658 • Letter: P

Question

Please write function/object/classes/prototype names that would be used in this project below. NOTE, working in C++.

***An example of a function for a bank application would be something like
double bankaccount_deposit();






PROJECT BELOW:

"MAKING STREET LIGHTS SMARTER"

The following is the proposal:

"We will develop a 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"

We are required to make a smart street lamp that automatically turns on or off based on the scenarios like date, time, etc

this can be done through coding by checking various function blocks.

these function blocks consists of conditions that determine whether the light should be on or off,

lets start with the few conditions

determine the time, the light should be on for a period of time, like 7pm to 7am.

day- the light can be on for extended hours on the weekends.

temperature- the light should be on during the low temperature.

Rain- The light should be on during the rain.

Sunlight- the light should automatically get on when the sunlight is low.

The brightness of the street light should be dependent on above mentioned factors.

these are few of the conditions on which the smart street light will decide whether it needs to be on or off.

the values in the variables can be obtained in the code through internet( values such as temperature, sunlight, rain etc)

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.