Find us on Google+ Kill the code: A simple VB .net Program using class and subroutine

Wednesday 1 August 2012

A simple VB .net Program using class and subroutine



Public Class area
Dim a As Integer
Dim b As Integer
Dim area As Integer

Public Sub getdata()

Console.WriteLine("Enter The Length a = ")
a=Convert.ToInt32(Console.ReadLine())

Console.WriteLine("Enter The width b = ")
b=Convert.ToInt32(Console.ReadLine())
End Sub

Public Function getarea() As Integer
area = (a * b)
return area
End Function


End Class

Module Module1
Sub Main()
Dim s1 As New area
s1.getdata()
Console.WriteLine("Area is {0}",s1.getarea() )

End Sub
End Module

No comments:

Post a Comment