finished 19 (not fully tested...)
[williamcminus.git] / assign6 / assignments.txt
bloba48da3a4fef841de06e0dd487952d879bca10f10
1 BEGIN\r
2     BEGIN {Temperature conversions.}\r
3         five  := -1 + 2 - 3 + 4 + 3;\r
4         ratio := five/9.0;\r
5 \r
6         fahrenheit := 72;\r
7         centigrade := (fahrenheit - 32)*ratio;\r
8 \r
9         centigrade := 25;\r
10         fahrenheit := centigrade/ratio + 32;\r
12         centigrade := 25;\r
13         fahrenheit := 32 + centigrade/ratio\r
14     END;\r
16     {Runtime division by zero error.}\r
17     dze := fahrenheit/(ratio - ratio);\r
19     BEGIN {Calculate a square root using Newton's method.}\r
20         number := 2;\r
21         root := number;\r
22         root := (number/root + root)/2;\r
23         root := (number/root + root)/2;\r
24         root := (number/root + root)/2;\r
25         root := (number/root + root)/2;\r
26         root := (number/root + root)/2;\r
27     END;\r
29     ch  := 'x';\r
30     str := 'hello, world'\r
31 END.\r