CS99 Fall 2002 Lab #5 (9/31/02) Due 10/4 at noon. 1. Objectives Completing all tasks in this assignment will help you: - write nested selection statements - use $mod$ - concatenate strings First skim, and then, carefully read the *entire* exercise before starting any tasks! 2. Temperatures Write a script M-File $temperature.m$ that will rate a user-input temperature. To determine the rating, your program will: - obtain a user input temperature. Assume that the user enters a real number in degrees Fahrenheit. If the user enters an illegal numerical value, the program finishes with a warning. Note that no temperature may be lower than -459.67 F. - determine an initial rating based on initial temperature ranges - A temperature of at least 90 F is "hot". - A temperature of at least 80 F and below 89F is "warm". - A temperature of at least 70 F and below 79F is "OK". - A temperature of at least 60 F and below 69F is "cool". - A temperature below 59 F is "cold". - modify the rating based on the specific temperature range: - If the temperature is warm or hot, then the first three values in the range are modified as "almost", whereas the last three values are modified as "very". - If the temperature is cool or cold, the modifications are reversed. - If the temperature is OK, no modifications are needed. - report the rating Preferrably, you should use nested selection statements, the $mod$ or $rem$ function, and concatenate strings to produce the appropriate ratings. Example sessions: Enter temperature: 52 Your temperature is very cold. Enter temperature: 67 Your temperature is almost cool. Enter temperature: 99 Your temperature is very hot. E-mail the script .M file to me by Friday at noon.