My programming teacher asked this question and I could not understand why I have to use one of these formulas to scale the temperature. And I also could not identify what the correct answer would be. You have the variable temperature, which ranges from -40 to +40. You want to change the RedValue variable ranging from 0 to 255 as the temperature goes from -40 to +40. What is the correct answer?
a.255*(temp+40)/80
b. 255*(temp-40)/40
c. 255-(temp+40)/80
d. 255*(temp-40)/80
e.255-(temp+40)/40