Initial data commit
This commit is contained in:
parent
72d218235f
commit
f23f22d71c
199087 changed files with 3378941 additions and 0 deletions
15
Task/Classes/F-Sharp/classes-2.fs
Normal file
15
Task/Classes/F-Sharp/classes-2.fs
Normal file
|
|
@ -0,0 +1,15 @@
|
|||
open System
|
||||
|
||||
type Shape =
|
||||
abstract Perimeter: unit -> float
|
||||
abstract Area: unit -> float
|
||||
|
||||
type Circle(radius) =
|
||||
interface Shape with
|
||||
member x.Perimeter() = 2.0 * radius * Math.PI
|
||||
member x.Area() = Math.PI * radius**2.0
|
||||
|
||||
type Rectangle(width, height) =
|
||||
interface Shape with
|
||||
member x.Perimeter() = 2.0 * width + 2.0 * height
|
||||
member x.Area() = width * height
|
||||
Loading…
Add table
Add a link
Reference in a new issue