Question: task 1 : create a c + + program that Uses the rand ( ) function to generate random temperature and humidity readings for three
task : create a c program that Uses the rand function to generate random temperature and humidity readings for three sensors
Each temperature should be a random floatingpoint value between deg C and deg C
Each humidity reading should be a random integer between and
Display the simulated sensor data.
Task : Data Comparison and Alerts Comparison Operations
Define temperature and humidity thresholds egdeg C for temperature and for humidity
Compare each sensors data to the thresholds.
If the temperature exceeds the threshold, display an alert that the room is too hot.
If the humidity is below the threshold, display an alert for low humidity.
Output the result of the comparison for each sensor
Task : Data Processing Math Operations
Calculate the average temperature across the sensors
Convert the average temperature from Celsius to Fahrenheit using the formula:
FahrenheitCelsiustimes
Print the average temperature in both Celsius and Fahrenheit.
Task : Sensor Status Encoding Bitwise Operations
For each sensor encode a status using bitwise operations:
Use bit to represent if the temperature is above the threshold for true, for false
Use bit to represent if the humidity is below the threshold for true, for false
Display the binary status for each sensor eg means temperature is fine but humidity is low
Task : Logging Sensor Data String Manipulation
Use string manipulation to log the sensor names eg "Living Room", "Bedroom", "Kitchen"
Concatenate each sensors name with its temperature and humidity readings and formatted status.
Format the output using setw and setprecision to display aligned sensor logs
Step by Step Solution
There are 3 Steps involved in it
1 Expert Approved Answer
Step: 1 Unlock
Question Has Been Solved by an Expert!
Get step-by-step solutions from verified subject matter experts
Step: 2 Unlock
Step: 3 Unlock
