How to do the following on MATLAB Create a program that prompts the user to ente
ID: 1766747 • Letter: H
Question
How to do the following on MATLAB
Create a program that prompts the user to enter a scalar value for the outside temperature, and assign it to the variable 'temperature'. If the temperature is equal to or above 80°F, send a message to the command window telling the user to wear shorts. If the temperature is between 60oF and 80oF, send a message to the command window telling the use thatit is a beautiful day. If the temperature is equal to or below 60°F, send a message telling the user to wear a jacket or coat. Try a sample run for the program for the temperature of 75 deg.Explanation / Answer
clear
clc
prompt = 'What is the value of temperature? ';
T = input(prompt)
if T>60
if T >=80
disp 'wear shorts'
else
disp 'it is a beutiful day'
end
else
disp 'wear a jacket or coat'
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.