Lab Manual
Lab Manual
Design an application to open a text file, modify it and save the changes using built in
dialog boxes.
2. Write a program to perform various arithmetic operations and implement exception
handling.
3. Design a Student Registration Application to store the student data in the database
using ADO.Net.
Examination:
1. One Question has to be given from the above list (Carries 45 Marks).
2. One more question has to be given by the examiner by his choice and that question
need not be in the list (Carries 35 Marks). Student has to answer and execute both
questions.
Marks Distribution:
Criteria Marks
Question from The List Examiner’s Question
Practical
Proper
Writing Program 25 20
Execution 20 15
Total 80
IA-Viva/Report 20
Total 100
You tube links
https://www.youtube.com/playlist?list=PLgfNsCf7RQxdAG3_-RyIjaGO09rI8WFlA
1. Write a program to convert a given temperature from Fahrenheit to Celsius and viceversa.
Module Module1
Sub Main()
End Sub
End Module
OUTPUT
Module Module1
Sub Main()
Console.WriteLine("***Entered Details***")
Console.WriteLine("RollNo:{0}", rollNo)
Console.WriteLine("Name:{0}", name)
Console.WriteLine("Mark1:{0}", mark1)
Console.WriteLine("Mark2:{0}", mark2)
Console.WriteLine("Total:{0}", total)
Console.WriteLine("Average:{0}", average)
Console.WriteLine("Grade:{0}", grade)
Console.ReadLine()
End Sub
End Module
OUTPUT
3. Write a program to generate n random numbers .( using rnd() function)
Module Module1
Sub Main()
End Sub
End Module
OUTPUT
4. Write a program to find frequency of a given character in a string .( using for each
Sub Main()
Next
Console.WriteLine("Frequencey of {0} is :{1}", ipChar, charFreq)
Console.ReadLine()
End Sub
End Module
OUTPUT:
5. Write a program to accept array elements and find the minimum and maximum among
them.
Module Module1
Sub Main()
Next
For i = 0 To n - 1
If arr(i) > max Then
max = arr(i)
End If
Next
Console.WriteLine()
Console.WriteLine("Minimum=" & min)
Console.WriteLine("Maximum=" & max)
Console.ReadLine()
End Sub
End Module
OUTPUT:
Journal Programs
userName = txtUserName.Text
password = txtPwd.Text
End If
End Sub
End Class
OUTPUT:
2. Design an application to simulate the working of a font dialog box using combo box.
size = CSng(cmbFSize.SelectedItem)
font = CStr(cmbFont.SelectedItem)
fontStyle = CStr(cmbFStyle.SelectedItem)
If chkStrikeout.Checked Then
lblSample.Font = New Font(font, size, Drawing.FontStyle.Strikeout)
chkUnderLine.Checked = False
End If
If chkUnderLine.Checked Then
lblSample.Font = New Font(lblSample.Font.FontFamily, size,
Drawing.FontStyle.Underline)
chkStrikeout.Checked = False
End If
End Sub
chkStrikeout.Checked = False
chkUnderLine.Checked = False
End Class
OUTPUT:
3. Design a reminder application to schedule a meeting using calendar and input box.
Imports System.IO
Dim m As MsgBoxResult
Dim t As String
Private Sub MonthCalendar1_DateSelected(sender As Object, e As
DateRangeEventArgs) Handles MonthCalendar1.DateSelected
t = MonthCalendar1.SelectionRange.Start.Month.ToString &
MonthCalendar1.SelectionRange.Start.Day.ToString
Try
If File.Exists(t & ".txt") = True Then
MonthCalendar1.Enabled = False
MonthCalendar1.Hide()
TextBox1.Enabled = True
TextBox1.Show()
btnSave.Enabled = True
btnSave.Show()
btnBack.Enabled = True
btnBack.Show()
TextBox1.Text = File.ReadAllText(t & ".txt")
Else
m = MsgBox("Would you like to have appointment for this date?",
MsgBoxStyle.YesNo)
If m = MsgBoxResult.Yes Then
MonthCalendar1.Enabled = False
MonthCalendar1.Hide()
TextBox1.Enabled = True
TextBox1.Show()
TextBox1.Text = ""
btnSave.Enabled = True
btnSave.Show()
btnBack.Enabled = True
btnBack.Show()
End If
End If
Catch ex As Exception
MsgBox(ex.Message)
End Try
End Sub
End If
End If
End Sub
End Class
OUTPUT:
4. Design a screen saver application using timer control.
5. Design an application to create an MDI form having a menu with options- programs and
exit. The program menu should have sub menu items that calls separate child forms such as
Fibonacci and factorial.
Parent Form
Child Form: 1
Label2.Visible = True
Label2.Text = "Factorial of given range: " + CStr(fact)
End Sub
Child Form: 2
Next
End Sub
End Class
OUTPUT:
Parent Form
Child Form1
Child Form 2
6. Design an Pizza Order application using check box and radio buttons and also generate a
bill for the same.
Public Class Lab6
End Function
If RadioButton1.Checked Then
price += 50
ElseIf RadioButton2.Checked Then
price += 70
ElseIf RadioButton3.Checked Then
price += 90
End If
Return price
End Function
Return strbill
End Function
End Class
OUTPUT:
End Sub
End Class
OUTPUT:
End Class
OUTPU
End Sub
OUTPU
10. Write a program to accept sides of a triangle and then find its area, perimeter and type of
triangle using classes (OOP).
https://www.mathwarehouse.com/geometry/triangles/triangle-types.php
Triangle Class
End Sub
Public Sub New(objTri As Triangle)
angle1 = objTri.angle1
angle2 = objTri.angle2
angle3 = objTri.angle3
side1 = objTri.side1
side2 = objTri.side2
side3 = objTri.side3
End Sub
Public Function areaOfTriangle() As Integer
Dim perimeter As Integer
Dim area As Integer
perimeter = perimeterOfTriangle()
area = Math.Sqrt(perimeter * (perimeter - side1) * (perimeter - side2) * (perimeter -
side3))
Return area
End Function
End Class
OUTPUT:
11. Design an application to open a text file, modify it and save the changes using built in
dialog boxes.
Public Class Lab11
End Sub
End Class
OUTPUT:
12. Write a program to perform various arithmetic operations and implement exception
handling.
Try
operand1 = TextBox1.Text
operand2 = TextBox2.Text
Dim clickedButton = TryCast(sender, Button)
If clickedButton IsNot Nothing Then
Dim tagValue As Integer
tagValue = CInt(clickedButton.Tag)
End Select
End If
Catch e1 As
DivideByZeroException result =
e1.ToString
MessageBox.Show("Exception Caught:" + result, "Exception")
Catch e2 As IO.IOException
result = e2.ToString
MessageBox.Show("Exception Caught:" + result, "Exception")
Catch e3 As InvalidCastException
result = e3.ToString
MessageBox.Show("Exception Caught:" + result, "Exception")
Finally
MessageBox.Show("Finally Block:" + result, "Finally")
End Try
End Sub
End Class
OUTPUT:
13. Design a Student Registration Application to store the student data in the database using
ADO.Net.
Imports System.Data.SqlClient
End Sub
Catch ex As Exception
MessageBox.Show("Error while inserting record on table..." & ex.Message, "Insert
Records")
Finally
con.Close()
End Try
Return result
End Function
End Class
OUTPUT: