Code:
Module Module1
Public Class Student
Public s1, s2, s3 As Integer
Public avg, sum As Double
Sub accept()
Console.WriteLine(" Enter marks of 3 subject: ")
s1 = Console.ReadLine()
s2 = Console.ReadLine()
s3 = Console.ReadLine()
sum = s1 + s2 + s3
avg = sum / 3.0
End Sub
Sub display()
Console.WriteLine("Average: " & avg)
End Sub
End Class
Sub Main()
Dim s As New Student
s.accept()
s.display()
Console.ReadKey()
End Sub
End Module
Module Module1
Public Class Student
Public s1, s2, s3 As Integer
Public avg, sum As Double
Sub accept()
Console.WriteLine(" Enter marks of 3 subject: ")
s1 = Console.ReadLine()
s2 = Console.ReadLine()
s3 = Console.ReadLine()
sum = s1 + s2 + s3
avg = sum / 3.0
End Sub
Sub display()
Console.WriteLine("Average: " & avg)
End Sub
End Class
Sub Main()
Dim s As New Student
s.accept()
s.display()
Console.ReadKey()
End Sub
End Module
Output: