Class Sample
Class Sample
Aim:
To find the Result Analysis Using Class using visual basic .net console
application
Coding:
Class sample
Dim name, result As String
Dim rollno, total As Integer
Dim eng, tam, mat As Integer
Dim tmark, avg As Integer
Dim check As Integer
Function input()
Console.WriteLine("enter the name")
name = Console.ReadLine
Console.WriteLine("enter the rollno")
rollno = Console.ReadLine
Console.WriteLine("enter the 3 marks")
eng = Console.ReadLine
tam = Console.ReadLine
mat = Console.ReadLine
Return (0)
End Function
Function processing()
If (eng >= 35 And tam >= 35 And mat >= 35) Then
check = 1
Else
check = 0
End If
Select Case check
Case 0
result = "fail"
Case 1
result = "pass"
End Select
End Function
Function output()
check = 0
Console.WriteLine("name={0}", name)
tmark = eng + tam + mat
avg = tmark / 3
Console.WriteLine("rollno={0}\n and total={1} and average={2},result={3}",
rollno, tmark, avg, result)
Return (0)
End Function
End Class
Module module1
Sub Main()
Dim s As New sample()
s.input()
s.processing()
s.output()
Console.Read()
End Sub
End Module
Output: