' Module paramByVal
' Sub swap(x As Integer, y As Integer)
' Dim temp As Integer
' temp = x
' x = y
' y = temp
' End Sub
' Sub Main(args As String())
' Dim a As Integer = 100, b As Integer = 200
' Console.WriteLine($"Before swap,the value of a is {a},the value of b is {b}")
' swap(a,b)
' Console.WriteLine($"Afte swap,the value of a is {a},the value of b is {b}")
' End Sub
' ' Sub a(ByVal i As Integer)
' ' Console.WriteLine(i)
' ' End Sub
' ' Function a(ByVal c As Integer, ByVal k As Integer) As Integer
' ' return c * k
' ' End Function
' End Module
Module myBox
Class box
private length As Integer
private width As Integer
private height As Integer
public Sub New(len As Integer, wid As Integer, hei As Integer)
length=len
width=wid
height=hei
End Sub
public Sub setLength(len As Integer)
length=len
End Sub
public Sub setWidth(wid As Integer)
width=wid
End Sub
public Sub setHeight(hei As Integer)
height=hei
End Sub
public Function getLength() As Integer
return length
End Function
public Function getWidth() As Integer
return width
End function
public Function getHeight() As Integer
return height
End Function
Function getVolumn() As Integer
return length*width*height
End Function
' Shared Sub Main(args As String())
' Dim box1 As box = New box(2,3,4)
' Dim length,width,height,volumn As Integer
' length=box1.getLength()
' width=box1.getWidth()
' height=box1.getHeight()
' volumn=box1.getVolumn()
' ' Console.WriteLine($"The length of the box is {length}")
' ' Console.WriteLine($"The width of the box is {width}")
' ' Console.WriteLine($"The height of the box is {height}")
' Console.WriteLine($"The volumn of the box is {volumn}")
' End Sub
End Class
Sub Main(args As String())
Dim box1 As box = New box(2,3,4)
Dim length,width,height,volumn As Integer
box1.setLength(4)
box1.setWidth(5)
box1.setHeight(6)
length=box1.getLength()
width=box1.getWidth()
height=box1.getHeight()
volumn=box1.getVolumn()
Console.WriteLine($"The length of the box is {length}")
Console.WriteLine($"The width of the box is {width}")
Console.WriteLine($"The height of the box is {height}")
Console.WriteLine($"The volumn of the box is {volumn}")
End Sub
End Module