|
|
|
|
|
|
|
Input: Temperature, an int value. |
|
|
|
|
|
|
|
|
Discussion: We must compare the temperature with the limits of each activity. Once the correct range is found, the corresponding activity is printed. We can make this comparison using If statements. |
|
|
|
|
|
|
|
|
Get temperature
Print activity |
|
|
|
|
|
|
|
|
|
|
Prompt for temperature value input
Read temperature
Echo-print temperature |
|
|
|
|
|
|
|
|
|
|
|
Print The recommended activity is
IF temperature > 85
Print swimming.
IF temperature <= 85 AND temperature > 70
Print tennis.
IF temperature <= 70 AND temperature > 32
Print golf.
IF temperature <= 32 AND temperature > 0
Print skiing.
IF temperature <= 0
Print dancing. |
|
|
|
|
|
|
|