Problem Description: Accept the temperature from the user. If the temperature is
greater than or equal to 32, display a message "The climate is good today" and check
whether the temperature is exactly equal to 32. If it is exactly equal to 32, display a
message "The temperature is 32". If the temperature is greater than 32, then display
a message "It is hot today"
VulpesRank #55 · 29.2K reputationPosted Nov 16, 2011, 1:29 PM EST
Mike Patel7 reputationPosted Nov 16, 2011, 2:52 PM EST
double temperature = double.parse(Console.ReadLine());
Vipul KelkarRank #1,061 · 1.8K reputationPosted Nov 16, 2011, 4:35 PM EST
In the statement
double temperature = double.parse(Console.ReadLine());
DOUBLE is the data type of the variable "temperature" as temperature can be a decimal value like 32.5, 19.1 etc. This is where we have declared our variable.
We have accepted the value from the user which is 'Console.ReadLine()' part.
This returns the user input as a string. To store it in a variable of type double, we have converted the string using double.parse()