Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Your friend's family has been in the farming business for generations. They are worried that at times they are supplying either too much, or too

Your friend's family has been in the farming business for generations. They are worried that at times they are supplying either too much, or too little fertilizer and other agricultural chemicals to their crops, resulting in uneven growth. Their land has a series of strategically placed sensors that can detect sun light, temperature, and humidity, as well as a precise NTP-based clock, and applicators that can apply fertilizers and chemicals to their crops if directed to do so. They still need the application that will act as the go-between for the sensors and clock and direct their applicators to apply the fertilizer and other chemicals. They have hired you to write the program that will activate their fertilizer / chemical applicators when certain conditions are met.

Conditions to be Met

Chemicals should be applied when the following conditions are met:

It is light out (i.e. - not cloudy)
If light out, chemical / fertilizer applications will begin at 7:00AM and end at 6:00PM
The temperature must be between 55°F and 75°F (inclusive)
The humidity must be less than 50%
Behaviors of your Application

It will run 24 hours per day, 7 days per week, whether chemicals are being applied or not
If it is cloudy out, it will not apply chemicals
 
If it is light out but not within the 7:00AM to 5:59PM time range, it will not apply chemicals
If sun light and time parameters are met, but the temperature is not within range, it will not apply chemicals
If sun light and time parameters are met, but humidity is 50% or higher, it will not apply chemicals
You will check these four parameters every 5 minutes, which you will simulate by checking every 5 seconds
Your application will issue messages to the console indicating the status of the four parameters you are checking and whether chemicals are being applied.  You will only apply chemicals / fertilizer if all four parameters (sun light, time, temperature, and humidity) are met.

Your Hardware (Sensors) and Clock

The functions in your application will represent programmed sensors for the time, sunny or overcast, temperature and humidity.  There will be one function for each sensor returning True or False to the main body of your program, based on the parameters listed above, which in turn come from the Physical Programming Simulator or system clock.  You will then issue the appropriate messages to the console.

NOTE: There are many ways you could get the hour of the day for testing.  One way is to import the datetime module.  The following code would get you the hour in military time so that you could test it to see if your program should even be running.

Step by Step Solution

3.36 Rating (162 Votes )

There are 3 Steps involved in it

Step: 1

To create the program that activates the fertilizerchemical applicators ... 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

Step: 3

blur-text-image

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

Smith and Roberson Business Law

Authors: Richard A. Mann, Barry S. Roberts

15th Edition

1285141903, 1285141903, 9781285141909, 978-0538473637

More Books

Students also viewed these Programming questions