Department of Computer Science: (UCS15404) Lab Manual
Department of Computer Science: (UCS15404) Lab Manual
(UCS15404)
LAB MANUAL
For
Prepared By Approved By
Mrs.R.Sivasankari HOD
INDEX
10. Create an application using the form controls and perform all validation
operations.
11. Develop a program which makes use of String and String Builder class.
AIM:
To calculate the area of a circle for given radius using console application .
PROGRAM:
Module Module1
Sub Main()
Dim r, area As Double
Console.Write("Enter Radius:")
r = Console.ReadLine()
area = 3.14 * r * r
Console.Write("Area of Circle:")
Console.WriteLine(area)
Console.ReadKey()
End Sub
End Module
INPUT&OUTPUT:
RESULT:
Thus the program has been successfully completed & executed.
Exercise 2:
PROGRAM:
Public Class Form1
End Sub
End Class
INPUT&OUPUT:
RESULT:
Thus the program has been successfully completed & executed.
Exercise 3:
PROGRAM:
Public Class Form
RESULT:
Thus the program has been successfully completed & executed.
Exercise 4:
SALARY CALCULATION USING WINDOW APPLICATION
AIM:
To calculate salary using window application.
PROGRAM:
PublicClass Form1
INPUT&OUTPUT:
RESULT:
Thus the program as been successfully completed & executed.
Exercise 5:
RETREIVE IMAGES USING COMBOBOX AND BUTTON
AIM:
To retreive images using combobox and button.
PROGRAM:
Public Class Form1
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As
System.EventArgs) Handles Button1.Click
If (ComboBox1.SelectedIndex = 0) Then
PictureBox1.Image = Image.FromFile("C:\Users\sbca177\Desktop\s1.jpg")
ElseIf (ComboBox1.SelectedIndex = 1) Then
PictureBox1.Image = Image.FromFile("C:\Users\sbca177\Desktop\s2.jpg")
ElseIf (ComboBox1.SelectedIndex = 2) Then
PictureBox1.Image = Image.FromFile("C:\Users\sbca177\Desktop\s3.jpg")
ElseIf (ComboBox1.SelectedIndex = 3) Then
PictureBox1.Image = Image.FromFile("C:\Users\sbca177\Desktop\s4.jpg")
ElseIf (ComboBox1.SelectedIndex = 4) Then
PictureBox1.Image = Image.FromFile("C:\Users\sbca177\Desktop\s5.jpg")
End If
End Sub
End Class
INPUT&OUTPUT:
RESULT:
Thus the program has been successfully completed & executed.
Exercise 6:
AIM:
To simulate a paint brush application using mouse event.
PROGRAM:
Public Class Form1
Dim mybrush
Dim down As Boolean
End Sub
mybrush = Brushes.Black
Dim down = False
End Sub
End Sub
End Class
OUTPUT:
RESULT:
Thus the program has been successfully completed & executed.
Exercise 7:
PROGRAM:
Public Class Form1
RESULT:
Thus the program has been successfully completed & executed.
Exercise 8:
AIM:
To create a math calculator using window application for performing basic arithmetic
operation.
PROGRAM:
Public Class Form1
Dim fno, sno, ans As Single
Dim Operation As String
INPUT&OUTPUT:
RESULT:
Thus the program has been successfully completed & executed.
Exercise 9:
Create an Application using the Form Controls.
AIM:
To Create an Application using the Form Controls.
PROGRAM:
PublicClassForm1
EndSub
INPUT&OUTPUT:
RESULT:
Thus the program as been successfully completed & executed.
Exercise :10
AIM:
To validate a bio-data application form.
PROGRAM:
Public Class Form1
INPUT&OUTPUT:
RESULT:
Thus the program has been successfully completed & executed.
Exercise 11:
Develop a program which makes use of String and String Builder class
AIM:
To Develop a program which makes use of String and String Builder class.
PROGRAM:
Console Application
Imports System.Text
Module Module1
Sub Main()
'Replace
Dim builder1 AsNew Text.StringBuilder("Initialize the StringBuilder.")
builder1.Replace("the", "my")
Console.WriteLine(builder1.ToString)
'insert
Dim builder3 As Text.StringBuilder = New Text.StringBuilder("A cat")
Console.WriteLine(builder3)
builder3.Insert(1, " Fox")
Console.WriteLine(builder3)
'remove
builder3.Remove(5, 3)
Console.WriteLine(builder3)
Console.WriteLine("String")
Console.WriteLine("======")
'concatenate
Dim str1 AsString = "Visual"
Dim str2 AsString = "Basic .NET Programming"
Dim strres AsString = String.Concat(str1, str2)
Console.WriteLine(strres)
'copy
Dim strcopy AsString = String.Copy(strres)
Console.WriteLine(strcopy)
Console.ReadLine()
EndSub
EndModule
INPUT&OUTPUT:
RESULT:
Thus the program has been successfully completed & executed.
Exercise 12:
PROGRAM:
Public Class Form1
Dim str, txt As String
End Class
OUTPUT:
RESULT:
Thus the program has been successfully completed & executed.
Exercise 13:
AIM:
To develop a VB.NET application using menu
PROGRAM:
PublicClassForm1
PrivateSubHorizantalToolStripMenuItem_Click(sender AsSystem.Object, e
AsSystem.EventArgs) HandlesHorizantalToolStripMenuItem.Click
Me.LayoutMdi(MdiLayout.TileHorizontal)
EndSub
PrivateSubVerticalToolStripMenuItem_Click(sender AsSystem.Object, e
AsSystem.EventArgs) HandlesVerticalToolStripMenuItem.Click
Me.LayoutMdi(MdiLayout.TileVertical)
EndSub
PrivateSubArrangeIconsToolStripMenuItem_Click(sender AsSystem.Object, e
AsSystem.EventArgs) HandlesArrangeIconsToolStripMenuItem.Click
Me.LayoutMdi(MdiLayout.ArrangeIcons)
EndSub
EndClass
INPUT&OUTPUT:
RESULT:
Thus the program has been successfully completed & executed.
Exercise 14:
AIM:
To Create an application using Common Dialog Controls.
PROGRAM:
PublicClassForm1
EndClass
OUTPUT:
Page setup
Color
Font Dialog
Open File
RESULT:
Thus the program has been successfully completed & executed.
Exercise 15:
PROGRAM:
INPUT&OUTPUT:
RESULT:
Thus the program has been successfully completed & executed.