Write a function that evaluates the \"hotness\" level of water leaving a faucet.
ID: 3807392 • Letter: W
Question
Write a function that evaluates the "hotness" level of water leaving a faucet. Prior to exiting the faucet, cold and hot water are mixed together to adjust from 0 to 100%. The outlet temperature (T_o(degree F)) is rounded to the nearest whole number and may be found by T_o = (H_w) 165 + (1 - H_w) 62 where H_w is the percentage of hot water used and is entered as a decimal (i.e. 95% is entered as 0.95). There are four "hotness levels: extremely hot water, T_o greaterthanorequalto 142 degree F hot water, 110 lessthanorequalto T_oExplanation / Answer
function outlet_water()
disp('Enter probability');
x = input(prompt);
t=x*165+(1-x)*62;
if t>=142
disp('Extremly hot water');
elseif (110<=t && t<142)
disp('hot water');
elseif (85<=t && t<110)
disp('warm water');
else
disp('room temprature');
end
disp('temprature is: ');
disp(t);
end
end
Related Questions
Hire Me For All Your Tutoring Needs
Integrity-first tutoring: clear explanations, guidance, and feedback.
Drop an Email at
drjack9650@gmail.com
drjack9650@gmail.com
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.