Question: Define six variables of appropriate data type and assign them the following values: 3 5 . 5 , 3 0 . 5 , 2 2

Define six variables of appropriate data type and assign them the following values: 35.5,30.5,22.2,16.1,7.3,-1(notice this last value is negative one)
Write a function that will accept a decimal value representing the Celsius temperature, convert the value to Fahrenheit, and return that Fahrenheit value as a rounded integer value.
Hint 1: The formula to convert from C to F is, TempF = TempC *9/5+32Hint 2: An easy way to round integer values is to add .5 to the decimal value before converting it to integer.
Write a function that will accept an integer value representing the temperature in Fahrenheit. The function will check the value and determine the correct weather statement to return as a string value. The criteria for these statements are as follows:
>=95F A heat advisory has been issued.85F to 94F Pleasant but warm.70F to 84F Very pleasant weather today.50F to 69F Pleasant but cool.33F to 49F Cold weather.<=32F A freeze warning has been issued.
For each test variable, call the conversion function followed by a call to the weather statement function. After each call, display to the console the temperature in Celsius and in Fahrenheit followed by the appropriate weather statement as determined by the function.

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Programming Questions!