Lab Exercises
Lab Exercises
Lab Exercises
Public Class Form1
RadioButton1.Text = "Delhi"
RadioButton2.Text = "Pune"
RadioButton3.Text = "Mumbai"
RadioButton4.Text = "Chennai"
End If
If ComboBox1.SelectedItem() = "Question 2" Then
RadioButton1.Text = "Pune"
RadioButton2.Text = "Nagpur"
RadioButton3.Text = "Mumbai"
RadioButton4.Text = "Nagar"
End If
End Sub
Dim correct As String
Dim wrong As String
If RadioButton1.Checked Then
TextBox1.Text = correct
ElseIf RadioButton2.Checked Then
TextBox1.Text = wrong
ElseIf RadioButton3.Checked Then
TextBox1.Text = wrong
ElseIf RadioButton4.Checked Then
TextBox1.Text = wrong
End If
End If
If ComboBox1.SelectedItem() = "Question 2" Then
If RadioButton1.Checked Then
TextBox1.Text = wrong
ElseIf RadioButton2.Checked Then
TextBox1.Text = wrong
ElseIf RadioButton3.Checked Then
TextBox1.Text = correct
ElseIf RadioButton4.Checked Then
TextBox1.Text = wrong
End If
End If
End Sub
End Class
2. Write a Vb.net program to accept a character from keyboard and check whether it is vowel or
not. Also display the case of that character.
Public Class Form1
Dim ch As Char
ch = TextBox1.Text
Select Case ch
Case Else
End Select
End Sub
End Class
3. Write a Vb.net program to accept number from user into the TextBox. Calculate the square root of
that number also convert the entered number into binary number and display result into the Message
Box
Public Class Form1
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs)
Handles Button1.Click
Dim n As Integer
Dim sqr As Double
Dim rm As Integer
Dim str1 As String
n = CInt(TextBox1.Text)
sqr = Math.Sqrt(n)
While n
rm = n Mod 2
n = n \ 2
End While
MessageBox.Show("Square Roor :" & sqr & " Binary Number : " & str1)
StrReverse(str1)
End Sub
End Class