‘’;
PRACTICAL NO -02
Imports System
Namespace Student
Class StudentInfo
Public Sub DisplayInfo()
Console.WriteLine("Student Information:")
Console.WriteLine("Name: John Doe")
Console.WriteLine("Roll Number: 12345")
Console.WriteLine("Department: Computer Science")
End Sub
End Class
End Namespace
Module Program
Sub Main()
' Accessing the StudentInfo class from the Student namespace
Dim student As New Student.StudentInfo()
student.DisplayInfo()
End Sub
End Module
Write a program using InputBox(), MsgBox() & perform various arithmetic
expression.
PRACTICAL NO -03
PRACTICAL 05
1] Imports VOWEL_PRAC_5
Module Program
Sub Main(args As String())
Dim vowel As Char
Console.WriteLine("ENTER A VOWEL " & vowel)
Console.ReadLine()
Select Case vowel
Case "A"
Console.WriteLine(" THE ABOVE CHARACTER IS VOWEL ")
Case "E"
Console.WriteLine(" THE ABOVE CHARACTER IS VOWEL ")
Case "I"
Console.WriteLine(" THE ABOVE CHARACTER IS VOWEL ")
Case "O"
Console.WriteLine(" THE ABOVE CHARACTER IS VOWEL ")
Case "U"
Console.WriteLine(" THE ABOVE CHARACTER IS VOWEL ")
Case Else
Console.WriteLine(" THE ABOVE CHARACTER IS NOT A VOWEL ")
End Select
End Sub
End Module
2] Imports System
Module Program
Sub Main(args As String())
Dim a, b, result As Integer
Console.WriteLine(" Enter a number ")
a = Console.ReadLine()
b = Console.ReadLine()
result = a + b
Console.WriteLine(" addition is " & result)
result = a - b
Console.WriteLine(" substraction is " & result)
result = a * b
Console.WriteLine(" multiplication is " & result)
result = a / b
Console.WriteLine(" division is " & result)
End Sub
End Module
PRACTICAL – 06
2] Imports System
Module Program
Sub Main(args As String())
Dim i As Integer = 1
While i <= 50
If i Mod 2 = 0 Then
Console.WriteLine(i)
End If
i += 1
End While
End Sub
End Module
PRACTICAL -07
1]
2]
Imports System
Module Module1
Sub Main()
Dim i As Single
For i = 3.5F To 8.5F Step 0.5F
Console.WriteLine(i)
Next
Console.ReadKey()
End Sub
End Module
Practical -07
2] Imports System
Module Module1
Sub Main()
Console.WriteLine("Armstrong numbers between 1 and 500:")
For i = 1 To 500
If i = GetArmstrong(i) Then Console.WriteLine(i)
End If
Console.ReadLine()
End Sub
Function GetArmstrong(number As Integer) As Integer
Dim sum As Integer = 0
Dim a = number
Do While a > 0
sum += (a Mod 10) ^ 3
a \= 10
Loop
Return sum
End Function
End Module
2]
ublic Class Form1
Private Sub Form1_Load(sender As Object, e As EventArgs) Handles MyBase.Load
Dim b1 As New Button
b1.Text = "CLICK ME"
Me.Controls.Add(b1)
b1.Location = New Point(100, 100)
End Sub
End Class
1] Public Class Form1
Dim a, b, result As Integer
Private Sub Button1_Click(sender As Object, e As EventArgs) Handles Button1.Click
a = TextBox1.Text
b = TextBox2.Text
result = a + b
MsgBox("addition is " & result)
End Sub
Private Sub Button2_Click(sender As Object, e As EventArgs) Handles Button2.Click
a = TextBox1.Text
b = TextBox2.Text
result = a - b
MsgBox(" substraction is " & result)
End Sub
Private Sub Button3_Click(sender As Object, e As EventArgs) Handles Button3.Click
a = TextBox1.Text
b = TextBox2.Text
result = a / b
MsgBox(" division is " & result)
End Sub
End Class
Private Sub Button4_Click(sender As Object, e As EventArgs) Handles Button4.Click
a = TextBox1.Text
b = TextBox2.Text
result = a * b
MsgBox(" multiplication is " & result)
End Sub
End Class
2] Public Class Form1
Private Sub Button1_Click(sender As Object, e As EventArgs) Handles Button1.Click
Me.BackColor = Color.Aqua
End Sub
Private Sub Button2_Click(sender As Object, e As EventArgs) Handles Button2.Click
Me.BackColor = Color.Wheat
End Sub
Private Sub Button3_Click(sender As Object, e As EventArgs) Handles Button3.Click
Me.BackColor = Color.Thistle
End Sub
End Class
PRACTICAL NO -09
PRACTICAL NO -09