Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- fun perimeter(shape: Shape): Double = when (shape) {
- is Rectangle -> (shape.x + shape.y) * 2
- is Circle -> 2 * PI * shape.radius
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement