0% found this document useful (0 votes)
19 views2 pages

EXP 18 Net

Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
19 views2 pages

EXP 18 Net

Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 2

XIV

1. Implement A Program To Display Any Message At Runtime.

Module Module1
Class demo
Public Sub New()
Console.WriteLine(" Welcome To S2 Batch....")
End Sub
End Class
Sub Main()
Dim obj1 As demo = New demo()
Console.ReadKey()
End Sub
End Module
Dim obj As Volumebox = New Volumebox()
obj.Voulume(Val(TextBox1.Text), Val(TextBox2.Text),
Val(TextBox3.Text))
End Sub
End Class
Private Sub Form1_Load(sender As Object, e As EventArgs) Handles
MyBase.Load
End Sub

OUTPUT :
2. Implement A Program To Calculate Area Of Circle Using Parameterized
Constructor .

Module Module1
Class Circle
Public Sub New(ByVal r As Integer)
Dim ans As Integer
ans = 3.14 * r * r
Console.WriteLine(" The area of circle is : " & ans)
End Sub
End Class
Sub Main()
Dim obj1 As Circle = New Circle(5)
Console.ReadKey()
End Sub
End Module
Private Sub ComboBox1_SelectedIndexChanged(sender As Object, e As
EventArgs) Handles ComboBox1.SelectedIndexChanged
End Sub
Public Class average
Public Sub showavg(ByVal no1 As Integer, ByVal no2 As Integer)
Dim ans As Double
ans = no1 + no2
MsgBox("The average Of Box : " & ans / 2)
Return
End Sub
End Class
Private Sub Button1_Click(sender As Object, e As EventArgs) Handles
Button1.Click
Dim a, b As Integer
a = ComboBox1.SelectedItem
b = ComboBox2.SelectedItem
Dim obj As average = New average()
obj.showavg(a, b)
End Sub
Private Sub ComboBox2_SelectedIndexChanged(sender As Object, e As
EventArgs) Handles ComboBox2.SelectedIndexChanged
End Sub
Private Sub Form1_Load(sender As Object, e As EventArgs) Handles
MyBase.Load
End Sub
End Class

OUTPUT :

You might also like