Question
Using the programming language C Write a program that will ask for a desired temperature and it shifts the conditions in the Fig. shown below.
Using the programming language C
Write a program that will ask for a desired temperature and it shifts the conditions in the Fig. shown below.
-The program will ask for the room temperature and for the desired temperature.
- If desired temperature is less than 2.5 degrees from room temperature (higher or lower), then do not turn heating or cooling on.
- If desired temperature is 2.5 degrees or greater from room temperature (higher or lower), then set either the cooling or the heating to the proper state according to the diagram below.
- Display temperature, AC state, and Heater state.
Repeat the above steps three times. Program sample run is on the page below.
Program 2 Mechatronics Due 2 / 12 / 2020 midnight Sample program run: Write a program that will ask for a desired temperature and it shifts the conditions in the Fig. shown below. Please enter the room temperature: 90 Please enter the desired temperature: 65 printf cooling = 3 printf heating = 0 - The program will ask for the room temperature and for the desired temperature. - If desired temperature is less than 2.5 degrees from room temperature (higher or lower). then do not turn heating or cooling on. - If desired temperature is 2.5 degrees or greater from room temperature (higher or lower), then set either the cooling or the heating to the proper state according to the diagram below. - Display temperature, AC state, and Heater state. Please enter the room temperature: 68 Please enter the desired temperature: 69 printf cooling = 0 printf heating = 0 Repeat the above steps three times. Program sample run is on the page below. States Please enter the room temperature: 52, Please enter the desired temperature: 60 printf cooling = 0 printf heating = 1 Heater AC High - 31 Med - 2 execution time : 28.086 s Low -1 Process returned 0 (0x0)_ Press any key to continue. Off - 0 0- 60 70 0 80 40 50 90 Temp (F) Desired Temp = 72.5
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started