next up previous contents
Next: Exercise 3 (Variables) Up: Variables Previous: Variables

Exercise 2 (Variables)

Convert several temperatures ( $0C, 20C, 30C, 50C$) from Celsius to Fahrenheit-scale. The formula for transformations to Fahrenheit-degrees reads:

\begin{displaymath}T/F = 9/5 \cdot T/C + 32\end{displaymath}

Use variables for the temperatures.

Solution:

>> TC=20
TC = 20
>> TF=9/5*TC+32
TF = 68
>> TC=30
TC = 30
>> TF=9/5*TC+32   %  Repeat with arrow key
TF = 86
0



Helmut Dersch
2009-03-15