VB.NET Final Record (Autosaved)
VB.NET Final Record (Autosaved)
STUDENT NAME :
REGISTER
:
NUMBER
CLASS : SECTION :
YEAR &
:
SEMESTER
SUBJECT CODE :
SUBJECT TITLE :
APRIL 2024
SRM INSTITUTE OF SCIENCE AND TECHNOLOGY
FACULTY OF SCIENCE AND HUMANITIES
DEPARTMENT OF COMPUTER APPLICATIONS
SRM Nagar, Kattankulathur – 603 203
CERTIFICATE
SRM Institute of Science and Technology during the academic year 2023-2024.
04 SHOPPING CART
05 DIGITAL CLOCK
07 CALCULATORS
08 GRAPHICS
09 ANIMATION
10 SLIDESHOW
15 DATABASE CONNECTIVITY
Arithmetic Calculation
AIM:-To create a form for Arithmetic Calculation
ALGORITHM:-
FORM DESIGN:-
PROGRAM:-
OUTPUT:-
RESULT:-
Calculation of area using method overloading
ALGORITHM:-
STEP-3- Rectangle button to perform Textbox3= Textbox1*Textbox2 and print the result.
FORM DESIGN:-
PROGRAM:-
End Sub
End Sub
End If
End Sub
End Class
OUTPUT:-
RESULT:-
Student Marksheet
ALGORITHM:-
STEP-2- Add text boxes for the required details of the student.
STEP-3- Add textboxes to enter the student marks in the corresponding subjects.
STEP-4- Add a button as result and write the code for the following step5 to step7 .
STEP-5- Add a textbox for total and write the code to calculate the total mark of all
the subjects as total=s1+s2+s3+s4+s5.
STEP-6- Add a textbox for percentage and write the code to calculate the percentage for
the total mark as percentage =total/5.
STEP-7- Add a textbox for grade and write the code to calculate the grade for the
particular mark using conditional statements.
FORM DESIGN:-
PROGRAM:-
OUTPUT:-
RESULT:-
Shopping Cart
ALGORITHM:-
STEP-2- Create a combobox and add the items that are to be displayed.
STEP-4- Add two textbox to display the price of the items and the quantity.
PROGRAM:-
RESULT:-
Digital Clock
ALGORITHM:-
STEP-4- Specify the timer display with Hours, Minutes and Seconds.
FORM DESIGN:-
PROGRAM:-
End Sub
End Class
OUTPUT:-
RESULT:-
Sorting The Numbers
ALGORITHM:-
STEP-3- Add a button SORTING and write the code to display the sorted numbers in the
listbox.
STEP-4- Write the code using For loop to sort the numbers in ascending or descending order.
FORM DESIGN:-
PROGRAM:-
Module Module1
Dim arr As Integer() = New Integer(5) {}
Public Sub getval()
Dim i As Integer
Dim j As Integer
Dim temp As Integer = 0
Form1.ListBox1.Items.Add("Array elements are")
For i = 0 To 4 Step 1
arr(i) = Val(InputBox("enter the value"))
Form1.ListBox1.Items.Add(arr(i))
Next
End Sub
Public Sub Sort_asc()
Dim i As Integer
Dim j As Integer
Dim temp As Integer
For i = 0 To 4 Step 1
For j = 4 To i + 1 Step -1
If (arr(j) < arr(j - 1)) Then
temp = arr(j)
arr(j) = arr(j - 1)
arr(j - 1) = temp
End If
Next
Next
Form1.ListBox1.Items.Add("ASc ordered values")
For i = 0 To 4 Step 1
Form1.ListBox1.Items.Add(arr(i))
Next
End Sub
Public Sub Sort_dsc()
Dim i As Integer
Dim j As Integer
Dim temp As Integer
For i = 0 To 4 Step 1
For j = 4 To i + 1 Step -1
If (arr(j) > arr(j - 1)) Then
temp = arr(j)
arr(j) = arr(j - 1)
arr(j - 1) = temp
End If
Next
Next
Next
End Sub
End Module
Public Class Form1
End If
End Sub
End Sub
End Class
OUTPUT:-
RESULT:-
Calculator
ALGORITHM:-
STEP-2- Using the button tool to add the buttons for the integer from 0 to 9 and other
operation’s.
STEP-3- Add separate buttons for addition, subtract, multiplication, and divide and write
the code for the respective operations.
STEP-4- Add textbox that displays the values in the buttons when clicked.
STEP-5- When the buttons are clicked the respective actions will be performed during
the executions of code.
FORM DESIGN:-
PROGRAM:-
End Sub
End Select
TextBox1.Text = total
End Sub
End Class
OUTPUT:-
RESULT:-
Graphics
ALGORITHM:-
STEP-2- Open the Form1 design and double click the form1.vb to generate the codeing part.
STEP-3- Inside the coding part instantiate a Graphics object using Me.CreateGraphics().
STEP-4- Define the pen and colors using the color structure.
STEP-5- Draw lines using, ellipses, and rectangles on the form using the DrawLine,
DrawEllipse, and FillRectangle methods of the Graphics object.
STEP-6- Create an array of point objects to define the points for drawing curves, then use
the DrawCurve method to draw curves on the form.
PROGRAM:-
RESULT:-
Animation
ALGORITHM:-
STEP-3- In button1 write the code and set GoingUp to Ture and enable timer.
STEP-4- In button2 write the code and set GoingUp to False and enable timer.
STEP-5- In timer move the picturebox up if Goingup is true or down if Goingup is false.
FORM DESIGN:-
PROGRAM:-
End If
End If
End Sub
End Class
OUTPUT:-
RESULT:-
Slide Show
ALGORITHM:-
STEP-3- In checkbox1, enable the Timer with an interval of 100 milliseconds when the checkbox is
checked, otherwise disable the Timer .
STEP-4- In Timer1 , cycle through images in the imgaelist control by updating the
pictureboxlist with the next image in the list.
FORM DESIGN:-
PROGRAM:-
RESULT:-
String Handling Function
ALGORITHM:-
STEP-2- Use a listbox for creating a list of options lie, Concatenation, Comparison,
Length, Uppercase, Lowercase, Reverse, Substring
STEP-3- Write the code that pperforms the particular task as per the selected keyword from
the listbox.
STEP-4- Select the option from the listbox and the input message box will be displayed.
STEP-5- Inside the input message box give the input and the result will be displayed in the
textbox.
FORM DESIGN:-
PROGRAM:-
Public Class Form1
Dim A, B, P1, P2 As String
Dim n As Integer
Case 1
A = InputBox("ENTER THE FIRST STRING")
B = InputBox("ENTER THE SECOND STRING")
Dim c As Integer = StrComp(A, B)
If c = 0 Then
MessageBox.Show("BOTH ARE EQUAL")
Else
MessageBox.Show("BOTH ARE NOT EQUAL")
End If
Case 2
A = InputBox("ENTER THE STRING")
TextBox1.Text = Len(A)
Case 3
A = InputBox("ENTER THE STRING")
P1 = InputBox("ENTER THE STARTING POSITION")
P2 = InputBox("ENTER THE NUMBER OF CHARACTERS")
TextBox1.Text = Mid(A, P1, P2)
Case 4
A = InputBox("ENTER THE STRING")
TextBox1.Text = A.ToUpper()
Case 5
A = InputBox("ENTER THE STRING")
TextBox1.Text = A.ToLower()
Case 6
A = InputBox("ENTER THE STRING")
TextBox1.Text = StrReverse(A)
End Select
End Sub
End Class
OUTPUT:-
RESULT:-
File Handling Function
ALGORITHM:-
STEP-2- Add a Button1 in that write an array of bytes {65, 66, 67, 68, 69} to the file using
WriteByte method.
STEP-3- Add a Button2 which will be used to read the bytes from the files using
ReadBytes method until the file reaches the end, converts the byte array to a string
using System.Text.Encoding.ASCII.GetString and displays it in a message box.
STEP-4- Add Button3 which will be used to create the FileInfo when clicked, retrieves and
displays various properties of the file such as name, full name, size, and last write
time in a ListBox.
FORM DESIGN:-
PROGRAM:-
Imports System.IO
Public Class Form1
Next
fs.Close()
MsgBox("file created")
End Sub
Private Sub Button2_Click(sender As Object, e As EventArgs) Handles Button2.Click
Dim fs1 As New FileStream("test1.txt", FileMode.Open, FileAccess.Read)
Dim j As Integer
Dim pos As Integer = 0
Dim arr(10) As Byte
Do
j = fs1.ReadByte
If j <> -1 Then
arr(pos) = CByte(j)
pos = pos + 1
End If
Loop While j <> -1
MessageBox.Show(System.Text.Encoding.ASCII.GetString(arr))
End Sub
ListBox1.Items.Add(f.FullName)
ListBox1.Items.Add(f.Length())
ListBox1.Items.Add(f.LastWriteTime)
End Sub
End Class
OUTPUT:-
RESULT:-
Changing Background Color Of The Form
AIM:- To create a form for String Changing Background Color Of The Form
ALGORITHM:-
PROGRAM:-
Public Class Form1
Private Sub Button1_Click(sender As Object, e As EventArgs) Handles Button1.Click
BackColor = Color.Blue
End Sub
OUTPUT:-
RESULT:-
Menu Tool Strip
ALGORITHM:-
STEP-3- Add "Edit" menu with "Paste" and "Select All" options and write the respect code
for the options to perform its operations.
STEP-4- Add "Format" menu with "Font" and "Color" options and add the font and color
tools from the toolbox.
FORM DESIGN:-
PROGRAM:-
End Sub
End Sub
RichTextBox1.SaveFile(SaveFileDialog1.FileName)
End If
End Sub
End Sub
End Sub
End Class.
OUTPUT:-
RESULT:-
Database Connectivity
AIM:- To create a form for Database Connectivity
ALGORITHM:-
STEP-3- Select "Project Data Source" and then "Add New Project Data Source".
Then, choose "Database".
STEP-4- Choose "Dataset" and then "New Collection" to bring up a new window.
STEP-5- Specify the version of SQL Server from this new box.
STEP-6- After connecting, select the required table first, then the database.
STEP-7- Your data will start to fill the grid. Press "Finish."
STEP-8- The data from your table will now be displayed in the grid when you execute
the programme.
PROGRAM:-
OUTPUT:-
RESULT:-