Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- class MyMath{
- var x:Int=7
- var y:Int=12
- var calc1:Int{
- return x*y
- }
- var calc2:Int{
- return 2*(x*y)
- }
- var calc3:Double{
- return 2*3.14*Double(x)
- }
- }
- var myMath:MyMath=MyMath()
- print("שטח מלבן: \(myMath.calc1)")
- print("היקף מלבן: \(myMath.calc2)")
- print("היקף מעגל: \(myMath.calc3)")
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement