Last modified by chrisby on 2024/03/03 17:01

From version 3.2
edited by chrisby
on 2024/03/03 14:50
Change comment: There is no comment for this version
To version 2.4
edited by chrisby
on 2024/03/03 14:45
Change comment: There is no comment for this version

Summary

Details

Page properties
Content
... ... @@ -5,23 +5,19 @@
5 5   }
6 6  
7 7   type Circle struct {
8 - radius float
8 + length float
9 9   }
10 10  
11 11   func Area(g GeometricObject) float {
12 - switch type(g):
13 - case Square:
14 - return g.length * g.length
12 + switch (g.type()):
15 15   case Circle:
16 - return PI * g.radius * g.radius
14 + return
15 + case Square:
16 + return ...
17 17   }
18 18  
19 19   func Circumference(g GeometricObject) float {
20 - switch type(g):
21 - case Square:
22 - return 4 * g.length
23 - case Circle:
24 - return 2 * PI * g.radius
20 + ...
25 25   }
26 26  
27 27  #### Object-Oriented Style