module Multiply
def multiply()
return @v1*@v2
end
end
module Divide
def divide()
return @v1/@v2
end
end
class Cal
include Multiply,Divide
def initialize(v1,v2)
@v1 = v1
@v2 = v2
end
def add()
return @v1+@v2
end
def subtract()
return @v1-@v2
end
end
c = Cal.new(100,10)
p c.add()
p c.multiply()
p c.divide()
bW9kdWxlIE11bHRpcGx5CiAgZGVmIG11bHRpcGx5KCkKICAgIHJldHVybiBAdjEqQHYyCiAgZW5kCmVuZAptb2R1bGUgRGl2aWRlCiAgZGVmIGRpdmlkZSgpCiAgICByZXR1cm4gQHYxL0B2MgogIGVuZAplbmQKY2xhc3MgQ2FsCiAgaW5jbHVkZSBNdWx0aXBseSxEaXZpZGUKICBkZWYgaW5pdGlhbGl6ZSh2MSx2MikKICAgIEB2MSA9IHYxCiAgICBAdjIgPSB2MgogIGVuZAogIGRlZiBhZGQoKQogICAgcmV0dXJuIEB2MStAdjIKICBlbmQKICBkZWYgc3VidHJhY3QoKQogICAgcmV0dXJuIEB2MS1AdjIKICBlbmQKZW5kCgoKYyA9IENhbC5uZXcoMTAwLDEwKQpwIGMuYWRkKCkKcCBjLm11bHRpcGx5KCkKcCBjLmRpdmlkZSgp