Uncategorized

JS Forum question about temperature alter

In your small group, propose how you could add a function to the program.
This means that the weather application should contain an array, a loop, a branching statement and a function.
For example, you could use a function to prompt the user for input, or a function that can perform a calculation of some sort (i.e. Fahrenheit to Celsius). This is up to your group.
Below is the previous question as the reference, only need to answer the above one.
Write a program that provides a weather alert. Make sure your program does the following:
Set the temperature to be a variable.
Use either an IF statement or a SWITCH statement to determine what type of advisory to give for the temperature variable.If the temperature is 90 degrees or above, the program alerts a heat advisory
If the temperature is 80 – 90, the program alerts a heat warning
Do for three more levels of temperatures.