SlideShare a Scribd company logo
1 of 25
Shri Rawatpura Sarkar Institute of Technology-II
CSE/7th
/VB.NetLab/PreparedbyVivekKumarSinha
1
EXPERIMENT : 1
Aim: Visual basic an introduction of console and GUI programming technique Explain
new project window , property explorer , output window dynamic help, window
management .
The Visual Basic Express Edition integrated development environment (IDE) makes it easy for
you to create programs for Microsoft Windows. The IDE contains several tools that help you
design your applications and write, edit, and debug your application code. The following links
will help you to familiarize yourself with the Visual Basic Express Edition IDE.
 Start Page
The Start Page may be used to select from the recent projects. A New Project may also be
started from the start page by clicking on the New Project Link. This page is useful to
search for help in all the Visual Studio Languages. The start page is displayed in the
browser & its URL is vs:/default.htm
Shri Rawatpura Sarkar Institute of Technology-II
CSE/7th
/VB.NetLab/PreparedbyVivekKumarSinha
2
 Solution Explorer
Solution Exploreris the solution
directory and helps in managing
the open project files. The files
are displayed in a hierarchical
view. By default, Solution
Explorer is located on the right
side of the IDE. If Solution
Explorer is not visible, it can be
made visible by clicking View
Menu & then clicking the
Solution Explorer.
 ToolBox
The Toolbox is a container for all the controls
that can be added to a Windows Forms
application or a Windows Presentation
Foundation (WPF) application. By default,
theToolbox is located on the left side of the
integrated development environment (IDE). If
theToolboxis not visible, it can be made visible
by clicking View and then clicking ToolBox.
The controls in the ToolBox are divided to
various groups according to their functionality &
usability. The controls are not visible in the
ToolBox when you are not in the Code Editor.
The Control can be added to the Window Form
by dragging it to the Application Window.
Shri Rawatpura Sarkar Institute of Technology-II
CSE/7th
/VB.NetLab/PreparedbyVivekKumarSinha
3
The various categories in which the controls are grouped are:
Tab name Description
All Windows
Forms
Contains all the standard Windows Forms controls that are
available in theToolbox.
Common Controls Contains the most common controls that are typically used
in Windows-based applications.
Containers Contains controls that hold other controls, such as
GroupBox controls and Panel controls. Containers can help
isolate a set of controls from other controls on the form.
Menus and
ToolBars
Contains controls that enable you to create menus and
toolbars for your application, such as the MenuStrip and
ToolStrip controls.
Data Contains controls that help you easily work with data in
your application, such as the DataGridView control.
Components Contains components that typically do not have a user
interface, such as the Timer and the ErrorProvider.
Printing Contains controls that enable you to provide printing
capabilities to an application.
Dialogs Contains controls that let you use common dialog boxes in
your application, such as the SaveFileDialog,
FolderBrowserDialog and FontDialog controls.
 Properties Window
Properties of a form and any controls on the form in
the integrated development environment (IDE) can be
set by using the Properties window or by writing code
in the Code Editor. For example, to display text on a
button, you can set the button's Text property.
Shri Rawatpura Sarkar Institute of Technology-II
CSE/7th
/VB.NetLab/PreparedbyVivekKumarSinha
4
EXPERIMENT : 2
AIM: Write a program to find the average total grade of using if statement in console.
Module Module1
Sub Main()
Dim sub1, sub2, sub3 As Integer
Dim average As Integer
Dim name As String
Console.Write("Enter Student Name = > ")
name = Console.ReadLine()
Console.Write("Enter Marks for Subject 1 =>")
sub1 = Console.ReadLine()
sub1 = Convert.ToInt32(sub1)
Console.Write("Enter Marks for Subject 2 =>")
sub2 = Console.ReadLine()
sub2 = Convert.ToInt32(sub2)
Console.Write("Enter Marks for Subject 1 =>")
sub3 = Console.ReadLine()
sub3 = Convert.ToInt32(sub3)
average = (sub1 + sub2 + sub3) / 3
Console.Write("Your Result ")
Console.Write("Avergae Marks ")
Console.Write(average)
Console.Write("")
If average < 35 Then
Console.Write("Grade B")
ElseIf average >= 35 And average < 60 Then
Console.Write("Grade A")
ElseIf average >= 60 Then
Console.Write("Grade A")
End If
Console.ReadLine()
Shri Rawatpura Sarkar Institute of Technology-II
CSE/7th
/VB.NetLab/PreparedbyVivekKumarSinha
5
End Sub
End Module
output
Shri Rawatpura Sarkar Institute of Technology-II
CSE/7th
/VB.NetLab/PreparedbyVivekKumarSinha
6
EXPERIMENT NUMNER : 3
AIM: WAP TO ENTER ANY NO BETWEEN 1-7 AND PRINT APPROPREATE DAY AND
WEEKS
Module Module1
Sub Main()
Dim NUM As Integer
Console.WriteLine("Enter no between 1-7")
NUM = Console.ReadLine()
NUM = Convert.ToInt32(NUM)
If NUM = 1 Then
Console.Write("Sunday")
ElseIf NUM = 2 Then
Console.Write("Monday")
ElseIf NUM = 3 Then
Console.Write("Tuesday")
ElseIf NUM = 4 Then
Console.Write("Wednesay")
ElseIf NUM = 5 Then
Console.Write("Thursday")
ElseIf NUM = 6 Then
Console.Write("Friday")
ElseIf NUM = 7 Then
Console.Write("Saturday")
Else
Console.Write("Invalid Input")
End If
Console.ReadLine()
End Sub
End Module
Shri Rawatpura Sarkar Institute of Technology-II
CSE/7th
/VB.NetLab/PreparedbyVivekKumarSinha
7
OUTPUT
Shri Rawatpura Sarkar Institute of Technology-II
CSE/7th
/VB.NetLab/PreparedbyVivekKumarSinha
8
EXPERIMENT-4
Aim: Write a program to print the following Pattern using for loop.
*
* *
* * *
* * * *
* * * * *
Code:
Imports System.Console
Module PatternMod
Sub Main()
Dim n As Integer
Write("Enter the number of Rows for the pattern: ")
n = ReadLine()
For iAs Integer = 0 To n - 1
For j As Integer = 0 To n - i - 1
Write(" ")
Next
For j = 0 Toi
Write("* ")
Next
WriteLine()
Next
ReadKey()
End Sub
End Module
OUTPUT
Shri Rawatpura Sarkar Institute of Technology-II
CSE/7th
/VB.NetLab/PreparedbyVivekKumarSinha
9
Shri Rawatpura Sarkar Institute of Technology-II
CSE/7th
/VB.NetLab/PreparedbyVivekKumarSinha
10
EXPERIMENT-5
Aim: Write a program to input numbers in 1D Array & print in Ascending & Descending Order.
Code:
Imports System.Console
Module Arr1DMod
Sub Main()
Dim Arr() As Integer
Dim siz As Integer
Write("Enter the size of 1D Array: ")
siz = ReadLine()
ReDimArr(siz)
'Arr = {3, 6, 2, 4, 1}
Dim i, j, choice As Integer
WriteLine("Enter the Elements of the Array")
For i = 0 Tosiz - 1
Arr(i) = ReadLine()
Next
Reselect:
WriteLine("Select The Order To Display The Result")
WriteLine("1. Ascending Order" &vbLf& "2. Descending Order")
choice = ReadLine()
If choice = 1 Then
'Ascending Order
For i = 0 Tosiz - 1
For j = 0 Toi
If Arr(i) <Arr(j) Then
Dim temp As Integer
temp = Arr(i)
Arr(i) = Arr(j)
Arr(j) = temp
End If
Next
Next
ElseIf choice = 2 Then
'Descending Order
For i = 0 Tosiz - 1
For j = 0 Toi
If Arr(i) >Arr(j) Then
Dim temp As Integer
temp = Arr(i)
Arr(i) = Arr(j)
Arr(j) = temp
End If
Next
Next
Shri Rawatpura Sarkar Institute of Technology-II
CSE/7th
/VB.NetLab/PreparedbyVivekKumarSinha
11
Else
WriteLine("Wrong Choice!!! Reselect Option!!!")
GoTo Reselect
End If
If choice = 1 Then
WriteLine("The Array in Ascending Order is :")
Else
WriteLine("The Array in Descending Order is :")
End If
'Print list
For i = 0 Tosiz - 1
WriteLine(Arr(i))
Next
ReadKey()
End Sub
End Module
OUTPUT
Shri Rawatpura Sarkar Institute of Technology-II
CSE/7th
/VB.NetLab/PreparedbyVivekKumarSinha
12
EXPERIMENT -6
Aim: Write a program to input numbers in a 2D Array & perform the following operations:
i. Sum of all the numbers.
ii. Forward Diagonal & Backward Diagonal Matrix.
iii. Print Upper Triangular & Lower Triangular Matrix.
Code:
Imports System.Console
Module Array2DMod
Dim Arr2D(,) As Integer
Dim sizm, sizn As Integer
Sub Main()
Arr2dEntry()
Clear()
Arr2dDisp()
sumEleArr2D()
Clear()
Arr2dDisp()
FrwdDigArr2D()
Clear()
Arr2dDisp()
BkwdDigArr2D()
Clear()
Arr2dDisp()
LwrTriArr2D()
Clear()
Arr2dDisp()
UprTriArr2D()
End Sub
Public Sub Arr2dEntry()
Dim i, j As Integer
WriteLine("Enter the size for the 2D Array:")
sizm = ReadLine()
Shri Rawatpura Sarkar Institute of Technology-II
CSE/7th
/VB.NetLab/PreparedbyVivekKumarSinha
13
sizn = ReadLine()
ReDimArr2D(sizm, sizn)
WriteLine("Enter the " & (sizm * sizn) & " Elements of the Array:")
For i = 0 Tosizm - 1
For j = 0 Tosizn - 1
Arr2D(i, j) = ReadLine()
'Integer.Parse(ReadLine())
Next
Next
End Sub
Public Sub Arr2dDisp()
WriteLine("The Entered Matrix Is :")
WriteLine()
Dim i, j As Integer
For i = 0 Tosizm - 1
For j = 0 Tosizn - 1
Write(Arr2D(i, j) &vbTab)
Next
WriteLine(vbLf)
Next
ReadLine()
End Sub
Public Sub sumEleArr2D()
Dim i, j As Integer
Dim sum As Integer
For i = 0 Tosizm - 1
For j = 0 Tosizn - 1
sum += Arr2D(i, j)
Next
Next
WriteLine("Sum of the Elements of the 2D Array is : {0}", sum)
ReadLine()
End Sub
Public Sub FrwdDigArr2D()
WriteLine("Forward Diagonal Matrix: ")
WriteLine()
Dim i, j As Integer
If sizm = sizn Then
Shri Rawatpura Sarkar Institute of Technology-II
CSE/7th
/VB.NetLab/PreparedbyVivekKumarSinha
14
For i = 0 Tosizm - 1
For j = 0 Tosizn - 1
If i = j Then
Write(Arr2D(i, j) &vbTab)
Else
Write("0" &vbTab)
End If
Next
WriteLine(vbLf)
Next
Else
WriteLine("Forward Diagonal Matrix can only be printed for a triangular Matrix!!! so the Operation is
not possible!!!")
End If
ReadLine()
End Sub
Public Sub BkwdDigArr2D()
WriteLine("Backward Diagonal Matrix: ")
WriteLine()
Dim i, j As Integer
If sizm = sizn Then
For i = 0 Tosizm - 1
For j = 0 Tosizn - 1
If i = sizm - j - 1 Then
Write(Arr2D(i, j) &vbTab)
Else
Write("0" &vbTab)
End If
Next
WriteLine(vbLf)
Next
Else
WriteLine("Backward Diagonal Matrix can only be printed for a triangular Matrix!!! so the Operation is
not possible!!!")
End If
ReadLine()
End Sub
Public Sub LwrTriArr2D()
WriteLine("Lower Triangular Matrix: ")
WriteLine()
Dim i, j As Integer
If sizm = sizn Then
Shri Rawatpura Sarkar Institute of Technology-II
CSE/7th
/VB.NetLab/PreparedbyVivekKumarSinha
15
For i = 0 Tosizm - 1
For j = 0 Tosizn - 1
If j <= i Then
Write(Arr2D(i, j) &vbTab)
Else
Write("0" &vbTab)
End If
Next
WriteLine(vbLf)
Next
Else
WriteLine("Lower Triangular Matrix can only be printed for a triangular Matrix!!! so the Operation is not
possible!!!")
End If
ReadLine()
End Sub
Public Sub UprTriArr2D()
WriteLine("Upper Triangular Matrix: ")
WriteLine()
Dim i, j As Integer
If sizm = sizn Then
For i = 0 Tosizm - 1
For j = 0 Tosizn - 1
If j >= i Then
Write(Arr2D(i, j) &vbTab)
Else
Write("0" &vbTab)
End If
Next
WriteLine(vbLf)
Next
Else
WriteLine("Upper Triangular Matrix can only be printed for a triangular Matrix!!! so the Operation is not
possible!!!")
End If
ReadLine()
End Sub
End Module
OUTPUT
Shri Rawatpura Sarkar Institute of Technology-II
CSE/7th
/VB.NetLab/PreparedbyVivekKumarSinha
16
Shri Rawatpura Sarkar Institute of Technology-II
CSE/7th
/VB.NetLab/PreparedbyVivekKumarSinha
17
Shri Rawatpura Sarkar Institute of Technology-II
CSE/7th
/VB.NetLab/PreparedbyVivekKumarSinha
18
EXPERIMENT-7
Aim: Write a program to input numbers in a 2D Array & perform the following operations:
i. Sum of two matrices.
ii. Multiplication of two Matrices.
Code:
Imports System.Console
Module MatrixMod
Sub Main()
Dim m1(,) As Integer = matInput()
Dim m2(,) As Integer = matInput()
Dim madd(,) As Integer = matAdd(m1, m2)
matOutput(madd)
ReadKey()
Dim mmul(,) As Integer = matMul(m1, m2)
matOutput(mmul)
ReadKey()
End Sub
Public Function matInput()
Dim mat(,) As Integer
Dim sizm, sizn As Integer
WriteLine("Enter the Size of Matrix")
Write("size M :")
sizm = ReadLine()
Write("size N :")
sizn = ReadLine()
ReDimmat(sizm - 1, sizn - 1)
WriteLine("Enter the " &sizm * sizn& " elements of the matrix" &vbLf)
Dim i, j As Integer
For i = 0 Tosizm - 1
For j = 0 Tosizn - 1
mat(i, j) = ReadLine()
Next
Next
Return mat
End Function
Shri Rawatpura Sarkar Institute of Technology-II
CSE/7th
/VB.NetLab/PreparedbyVivekKumarSinha
19
Public Sub matOutput(ByVal mat(,) As Integer)
Dim sm, sn As Integer
sm = mat.GetUpperBound(0)
sn = mat.GetUpperBound(1)
WriteLine("The Matrix is ")
Dim i, j As Integer
For i = 0 Tosm
For j = 0 Tosn
Write(mat(i, j) &vbTab)
Next
WriteLine()
Next
End Sub
Public Function matAdd(ByVal m1(,) As Integer, ByVal m2(,) As Integer)
Dim mres(,) As Integer
Dim ubm1, ubm2, ubn1, ubn2 As Integer
ubm1 = m1.GetUpperBound(0)
ubm2 = m2.GetUpperBound(0)
ubn1 = m1.GetUpperBound(1)
ubn2 = m2.GetUpperBound(1)
If ubm1 = ubm2 AndAlso ubn1 = ubn2 Then
WriteLine("Matrix Addition Possible")
ReDimmres(ubm1, ubn1)
Dim i, j As Integer
For i = 0 To ubm1
For j = 0 To ubn1
mres(i, j) = m1(i, j) + m2(i, j)
Next
Next
Else
WriteLine("Addition of Matrix Not Possible!!!")
ReadKey()
End
End If
Return mres
End Function
Public Function matMul(ByVal m1(,) As Integer, ByVal m2(,) As Integer)
Dim mres(,) As Integer
Shri Rawatpura Sarkar Institute of Technology-II
CSE/7th
/VB.NetLab/PreparedbyVivekKumarSinha
20
Dim ubm1, ubm2, ubn1, ubn2 As Integer
ubm1 = m1.GetUpperBound(0)
ubm2 = m2.GetUpperBound(0)
ubn1 = m1.GetUpperBound(1)
ubn2 = m2.GetUpperBound(1)
If ubn1 = ubm2 Then
WriteLine("Matrix Multilication Possible")
ReDimmres(ubm1, ubn2)
Dim i, j, k As Integer
For i = 0 To ubm1
For j = 0 To ubn2
For k = 0 To ubn1
mres(i, j) += m1(i, k) * m2(k, j)
Next
Next
Next
Else
WriteLine("Matrix Multiplication Not Possible")
End
End If
Return mres
End Function
End Module
OUTPUT
Shri Rawatpura Sarkar Institute of Technology-II
CSE/7th
/VB.NetLab/PreparedbyVivekKumarSinha
21
Shri Rawatpura Sarkar Institute of Technology-II
CSE/7th
/VB.NetLab/PreparedbyVivekKumarSinha
22
EXPERIMENT : 8
AIM: WAP TO ENTER NO BETWEEN 1-12 AND DISPLAY APPROPRIAT MONTH NAME.
Module Module1
Sub Main()
Dim NUM As Integer
Console.WriteLine("Enter no between 1-12")
NUM = Console.ReadLine()
NUM = Convert.ToInt32(NUM)
If NUM = 1 Then
Console.Write("Janvery")
ElseIf NUM = 2 Then
Console.Write("Febvary")
ElseIf NUM = 3 Then
Console.Write("March")
ElseIf NUM = 4 Then
Console.Write("April")
ElseIf NUM = 5 Then
Console.Write("May")
ElseIf NUM = 6 Then
Console.Write("June")
ElseIf NUM = 7 Then
Console.Write("July")
ElseIf NUM = 8 Then
Console.Write("Augst")
ElseIf NUM = 9 Then
Console.Write("September")
ElseIf NUM = 10 Then
Console.Write("October")
ElseIf NUM = 11 Then
Console.Write("November")
ElseIf NUM = 12 Then
Console.Write("December")
Else
Shri Rawatpura Sarkar Institute of Technology-II
CSE/7th
/VB.NetLab/PreparedbyVivekKumarSinha
23
Console.Write("Invalid Input")
End If
Console.ReadLine()
End Sub
End Module
Output:
Shri Rawatpura Sarkar Institute of Technology-II
CSE/7th
/VB.NetLab/PreparedbyVivekKumarSinha
24
Shri Rawatpura Sarkar Institute of Technology-II
CSE/7th
/VB.NetLab/PreparedbyVivekKumarSinha
25

More Related Content

What's hot

What is SQL Server?
What is SQL Server?What is SQL Server?
What is SQL Server?CPD INDIA
 
Webmail and Mail Clients
Webmail and Mail ClientsWebmail and Mail Clients
Webmail and Mail ClientsSomeone Else
 
JDBC: java DataBase connectivity
JDBC: java DataBase connectivityJDBC: java DataBase connectivity
JDBC: java DataBase connectivityTanmoy Barman
 
CBSE XII Database Concepts And MySQL Presentation
CBSE XII Database Concepts And MySQL PresentationCBSE XII Database Concepts And MySQL Presentation
CBSE XII Database Concepts And MySQL PresentationGuru Ji
 
SRS for Hospital Management System
SRS for Hospital Management SystemSRS for Hospital Management System
SRS for Hospital Management Systemkataria Arvind
 
Text editors project
Text editors projectText editors project
Text editors projectMohit kumar
 
Synopsis on Online examination system using php
Synopsis on Online examination system using phpSynopsis on Online examination system using php
Synopsis on Online examination system using phpArchana Jha
 
A mini project on designing a DATABASE for Library management system using mySQL
A mini project on designing a DATABASE for Library management system using mySQLA mini project on designing a DATABASE for Library management system using mySQL
A mini project on designing a DATABASE for Library management system using mySQLsvrohith 9
 
Socket programming in Java (PPTX)
Socket programming in Java (PPTX)Socket programming in Java (PPTX)
Socket programming in Java (PPTX)UC San Diego
 
Front end web development
Front end web developmentFront end web development
Front end web developmentviveksewa
 

What's hot (20)

dot net unit-1.pdf
dot net unit-1.pdfdot net unit-1.pdf
dot net unit-1.pdf
 
What is SQL Server?
What is SQL Server?What is SQL Server?
What is SQL Server?
 
Introduction to .NET Framework
Introduction to .NET FrameworkIntroduction to .NET Framework
Introduction to .NET Framework
 
Webmail and Mail Clients
Webmail and Mail ClientsWebmail and Mail Clients
Webmail and Mail Clients
 
JDBC: java DataBase connectivity
JDBC: java DataBase connectivityJDBC: java DataBase connectivity
JDBC: java DataBase connectivity
 
CBSE XII Database Concepts And MySQL Presentation
CBSE XII Database Concepts And MySQL PresentationCBSE XII Database Concepts And MySQL Presentation
CBSE XII Database Concepts And MySQL Presentation
 
Dbms lab questions
Dbms lab questionsDbms lab questions
Dbms lab questions
 
Student record
Student recordStudent record
Student record
 
MYSQL.ppt
MYSQL.pptMYSQL.ppt
MYSQL.ppt
 
SRS for Hospital Management System
SRS for Hospital Management SystemSRS for Hospital Management System
SRS for Hospital Management System
 
Java servlets and CGI
Java servlets and CGIJava servlets and CGI
Java servlets and CGI
 
Mysql
MysqlMysql
Mysql
 
Power bi
Power biPower bi
Power bi
 
Text editors project
Text editors projectText editors project
Text editors project
 
Backend Programming
Backend ProgrammingBackend Programming
Backend Programming
 
Synopsis on Online examination system using php
Synopsis on Online examination system using phpSynopsis on Online examination system using php
Synopsis on Online examination system using php
 
A mini project on designing a DATABASE for Library management system using mySQL
A mini project on designing a DATABASE for Library management system using mySQLA mini project on designing a DATABASE for Library management system using mySQL
A mini project on designing a DATABASE for Library management system using mySQL
 
Socket programming in Java (PPTX)
Socket programming in Java (PPTX)Socket programming in Java (PPTX)
Socket programming in Java (PPTX)
 
Front end web development
Front end web developmentFront end web development
Front end web development
 
Vb.net class notes
Vb.net class notesVb.net class notes
Vb.net class notes
 

Viewers also liked

7305MED_AndreaTrubody_s5048151_assessment3_final
 7305MED_AndreaTrubody_s5048151_assessment3_final 7305MED_AndreaTrubody_s5048151_assessment3_final
7305MED_AndreaTrubody_s5048151_assessment3_finalAndrea Trubody
 
продукт проскуряковой и.в. гбоу сош оц п.г.т. рощинский. квн веселая информатика
продукт проскуряковой и.в. гбоу сош оц п.г.т. рощинский. квн веселая информатикапродукт проскуряковой и.в. гбоу сош оц п.г.т. рощинский. квн веселая информатика
продукт проскуряковой и.в. гбоу сош оц п.г.т. рощинский. квн веселая информатикаrcnovo
 
Momentum_2_2011-Black Belt Certification
Momentum_2_2011-Black Belt CertificationMomentum_2_2011-Black Belt Certification
Momentum_2_2011-Black Belt CertificationSergio Estivill
 
Hilton Worldwide - Train The Trainer Certification
Hilton Worldwide - Train The Trainer CertificationHilton Worldwide - Train The Trainer Certification
Hilton Worldwide - Train The Trainer CertificationKetsia David
 
державний стандарт
державний стандартдержавний стандарт
державний стандартltasenko
 
презентація попередження жорстокого поводження з дітьми
презентація попередження жорстокого поводження з дітьмипрезентація попередження жорстокого поводження з дітьми
презентація попередження жорстокого поводження з дітьмиПетр Наконечный
 
平台經濟模式心得分享
平台經濟模式心得分享平台經濟模式心得分享
平台經濟模式心得分享建夆 陳
 
Робота в термодинаміці
Робота в термодинаміціРобота в термодинаміці
Робота в термодинаміціvoykivskiy
 

Viewers also liked (11)

7305MED_AndreaTrubody_s5048151_assessment3_final
 7305MED_AndreaTrubody_s5048151_assessment3_final 7305MED_AndreaTrubody_s5048151_assessment3_final
7305MED_AndreaTrubody_s5048151_assessment3_final
 
продукт проскуряковой и.в. гбоу сош оц п.г.т. рощинский. квн веселая информатика
продукт проскуряковой и.в. гбоу сош оц п.г.т. рощинский. квн веселая информатикапродукт проскуряковой и.в. гбоу сош оц п.г.т. рощинский. квн веселая информатика
продукт проскуряковой и.в. гбоу сош оц п.г.т. рощинский. квн веселая информатика
 
Momentum_2_2011-Black Belt Certification
Momentum_2_2011-Black Belt CertificationMomentum_2_2011-Black Belt Certification
Momentum_2_2011-Black Belt Certification
 
Test
TestTest
Test
 
Hilton Worldwide - Train The Trainer Certification
Hilton Worldwide - Train The Trainer CertificationHilton Worldwide - Train The Trainer Certification
Hilton Worldwide - Train The Trainer Certification
 
Tarea 2
Tarea 2Tarea 2
Tarea 2
 
державний стандарт
державний стандартдержавний стандарт
державний стандарт
 
Unix lab
Unix labUnix lab
Unix lab
 
презентація попередження жорстокого поводження з дітьми
презентація попередження жорстокого поводження з дітьмипрезентація попередження жорстокого поводження з дітьми
презентація попередження жорстокого поводження з дітьми
 
平台經濟模式心得分享
平台經濟模式心得分享平台經濟模式心得分享
平台經濟模式心得分享
 
Робота в термодинаміці
Робота в термодинаміціРобота в термодинаміці
Робота в термодинаміці
 

Similar to Vb.net Experiment with Example

System programmin practical file
System programmin practical fileSystem programmin practical file
System programmin practical fileAnkit Dixit
 
Visual basic 6.0
Visual basic 6.0Visual basic 6.0
Visual basic 6.0Aarti P
 
CMIS 330 WEEK 4 SDD
CMIS 330 WEEK 4 SDDCMIS 330 WEEK 4 SDD
CMIS 330 WEEK 4 SDDHamesKellor
 
Presentation on visual basic 6 (vb6)
Presentation on visual basic 6 (vb6)Presentation on visual basic 6 (vb6)
Presentation on visual basic 6 (vb6)pbarasia
 
01 Database Management (re-uploaded)
01 Database Management (re-uploaded)01 Database Management (re-uploaded)
01 Database Management (re-uploaded)bluejayjunior
 
Ppt on visual basics
Ppt on visual basicsPpt on visual basics
Ppt on visual basicsyounganand
 
How to write clean & testable code without losing your mind
How to write clean & testable code without losing your mindHow to write clean & testable code without losing your mind
How to write clean & testable code without losing your mindAndreas Czakaj
 
01 Introduction to programming
01 Introduction to programming01 Introduction to programming
01 Introduction to programmingmaznabili
 
COM 211 PRESENTATION.pptx
COM 211 PRESENTATION.pptxCOM 211 PRESENTATION.pptx
COM 211 PRESENTATION.pptxAnasYunusa
 
PT1420 File Access and Visual Basic .docx
PT1420 File Access and Visual Basic                      .docxPT1420 File Access and Visual Basic                      .docx
PT1420 File Access and Visual Basic .docxamrit47
 

Similar to Vb.net Experiment with Example (20)

ASP.NET
ASP.NETASP.NET
ASP.NET
 
Vb net1
Vb net1Vb net1
Vb net1
 
System programmin practical file
System programmin practical fileSystem programmin practical file
System programmin practical file
 
Lecture 12 os
Lecture 12 osLecture 12 os
Lecture 12 os
 
Visual basic 6.0
Visual basic 6.0Visual basic 6.0
Visual basic 6.0
 
Visual Programming
Visual ProgrammingVisual Programming
Visual Programming
 
CMIS 330 WEEK 4 SDD
CMIS 330 WEEK 4 SDDCMIS 330 WEEK 4 SDD
CMIS 330 WEEK 4 SDD
 
Presentation on visual basic 6 (vb6)
Presentation on visual basic 6 (vb6)Presentation on visual basic 6 (vb6)
Presentation on visual basic 6 (vb6)
 
Introduction to Programming Lesson 01
Introduction to Programming Lesson 01Introduction to Programming Lesson 01
Introduction to Programming Lesson 01
 
01 Database Management (re-uploaded)
01 Database Management (re-uploaded)01 Database Management (re-uploaded)
01 Database Management (re-uploaded)
 
Ppt on visual basics
Ppt on visual basicsPpt on visual basics
Ppt on visual basics
 
How to write clean & testable code without losing your mind
How to write clean & testable code without losing your mindHow to write clean & testable code without losing your mind
How to write clean & testable code without losing your mind
 
Vb.net ide
Vb.net ideVb.net ide
Vb.net ide
 
Vb6.0 intro
Vb6.0 introVb6.0 intro
Vb6.0 intro
 
01 Introduction to programming
01 Introduction to programming01 Introduction to programming
01 Introduction to programming
 
COM 211 PRESENTATION.pptx
COM 211 PRESENTATION.pptxCOM 211 PRESENTATION.pptx
COM 211 PRESENTATION.pptx
 
VB.Net GUI Unit_01
VB.Net GUI Unit_01VB.Net GUI Unit_01
VB.Net GUI Unit_01
 
ArduinoWorkshop2.pdf
ArduinoWorkshop2.pdfArduinoWorkshop2.pdf
ArduinoWorkshop2.pdf
 
Android L01 - Warm Up
Android L01 - Warm UpAndroid L01 - Warm Up
Android L01 - Warm Up
 
PT1420 File Access and Visual Basic .docx
PT1420 File Access and Visual Basic                      .docxPT1420 File Access and Visual Basic                      .docx
PT1420 File Access and Visual Basic .docx
 

More from Vivek Kumar Sinha (20)

Software engg unit 4
Software engg unit 4 Software engg unit 4
Software engg unit 4
 
Software engg unit 3
Software engg unit 3 Software engg unit 3
Software engg unit 3
 
Software engg unit 2
Software engg unit 2 Software engg unit 2
Software engg unit 2
 
Software engg unit 1
Software engg unit 1 Software engg unit 1
Software engg unit 1
 
Data structure
Data structureData structure
Data structure
 
Mathematics basics
Mathematics basicsMathematics basics
Mathematics basics
 
E commerce 5_units_notes
E commerce 5_units_notesE commerce 5_units_notes
E commerce 5_units_notes
 
B.ped
B.pedB.ped
B.ped
 
Subject distribution
Subject distributionSubject distribution
Subject distribution
 
Revision report final
Revision report finalRevision report final
Revision report final
 
Lession plan mis
Lession plan misLession plan mis
Lession plan mis
 
Lession plan dmw
Lession plan dmwLession plan dmw
Lession plan dmw
 
Faculty planning
Faculty planningFaculty planning
Faculty planning
 
Final presentation on computer network
Final presentation on computer networkFinal presentation on computer network
Final presentation on computer network
 
Np syllabus summary
Np syllabus summaryNp syllabus summary
Np syllabus summary
 
Internet of things
Internet of thingsInternet of things
Internet of things
 
Induction program 2017
Induction program 2017Induction program 2017
Induction program 2017
 
Vivek
VivekVivek
Vivek
 
E magzine et&amp;t
E magzine et&amp;tE magzine et&amp;t
E magzine et&amp;t
 
Mechanical engineering department (1)
Mechanical engineering department (1)Mechanical engineering department (1)
Mechanical engineering department (1)
 

Recently uploaded

Introduction and different types of Ethernet.pptx
Introduction and different types of Ethernet.pptxIntroduction and different types of Ethernet.pptx
Introduction and different types of Ethernet.pptxupamatechverse
 
Call for Papers - African Journal of Biological Sciences, E-ISSN: 2663-2187, ...
Call for Papers - African Journal of Biological Sciences, E-ISSN: 2663-2187, ...Call for Papers - African Journal of Biological Sciences, E-ISSN: 2663-2187, ...
Call for Papers - African Journal of Biological Sciences, E-ISSN: 2663-2187, ...Christo Ananth
 
VIP Call Girls Service Kondapur Hyderabad Call +91-8250192130
VIP Call Girls Service Kondapur Hyderabad Call +91-8250192130VIP Call Girls Service Kondapur Hyderabad Call +91-8250192130
VIP Call Girls Service Kondapur Hyderabad Call +91-8250192130Suhani Kapoor
 
HARMONY IN THE NATURE AND EXISTENCE - Unit-IV
HARMONY IN THE NATURE AND EXISTENCE - Unit-IVHARMONY IN THE NATURE AND EXISTENCE - Unit-IV
HARMONY IN THE NATURE AND EXISTENCE - Unit-IVRajaP95
 
Sheet Pile Wall Design and Construction: A Practical Guide for Civil Engineer...
Sheet Pile Wall Design and Construction: A Practical Guide for Civil Engineer...Sheet Pile Wall Design and Construction: A Practical Guide for Civil Engineer...
Sheet Pile Wall Design and Construction: A Practical Guide for Civil Engineer...Dr.Costas Sachpazis
 
Call Girls Delhi {Jodhpur} 9711199012 high profile service
Call Girls Delhi {Jodhpur} 9711199012 high profile serviceCall Girls Delhi {Jodhpur} 9711199012 high profile service
Call Girls Delhi {Jodhpur} 9711199012 high profile servicerehmti665
 
MANUFACTURING PROCESS-II UNIT-5 NC MACHINE TOOLS
MANUFACTURING PROCESS-II UNIT-5 NC MACHINE TOOLSMANUFACTURING PROCESS-II UNIT-5 NC MACHINE TOOLS
MANUFACTURING PROCESS-II UNIT-5 NC MACHINE TOOLSSIVASHANKAR N
 
main PPT.pptx of girls hostel security using rfid
main PPT.pptx of girls hostel security using rfidmain PPT.pptx of girls hostel security using rfid
main PPT.pptx of girls hostel security using rfidNikhilNagaraju
 
Analog to Digital and Digital to Analog Converter
Analog to Digital and Digital to Analog ConverterAnalog to Digital and Digital to Analog Converter
Analog to Digital and Digital to Analog ConverterAbhinavSharma374939
 
Architect Hassan Khalil Portfolio for 2024
Architect Hassan Khalil Portfolio for 2024Architect Hassan Khalil Portfolio for 2024
Architect Hassan Khalil Portfolio for 2024hassan khalil
 
Call Girls in Nagpur Suman Call 7001035870 Meet With Nagpur Escorts
Call Girls in Nagpur Suman Call 7001035870 Meet With Nagpur EscortsCall Girls in Nagpur Suman Call 7001035870 Meet With Nagpur Escorts
Call Girls in Nagpur Suman Call 7001035870 Meet With Nagpur EscortsCall Girls in Nagpur High Profile
 
Software Development Life Cycle By Team Orange (Dept. of Pharmacy)
Software Development Life Cycle By  Team Orange (Dept. of Pharmacy)Software Development Life Cycle By  Team Orange (Dept. of Pharmacy)
Software Development Life Cycle By Team Orange (Dept. of Pharmacy)Suman Mia
 
(SHREYA) Chakan Call Girls Just Call 7001035870 [ Cash on Delivery ] Pune Esc...
(SHREYA) Chakan Call Girls Just Call 7001035870 [ Cash on Delivery ] Pune Esc...(SHREYA) Chakan Call Girls Just Call 7001035870 [ Cash on Delivery ] Pune Esc...
(SHREYA) Chakan Call Girls Just Call 7001035870 [ Cash on Delivery ] Pune Esc...ranjana rawat
 
SPICE PARK APR2024 ( 6,793 SPICE Models )
SPICE PARK APR2024 ( 6,793 SPICE Models )SPICE PARK APR2024 ( 6,793 SPICE Models )
SPICE PARK APR2024 ( 6,793 SPICE Models )Tsuyoshi Horigome
 
Microscopic Analysis of Ceramic Materials.pptx
Microscopic Analysis of Ceramic Materials.pptxMicroscopic Analysis of Ceramic Materials.pptx
Microscopic Analysis of Ceramic Materials.pptxpurnimasatapathy1234
 
(PRIYA) Rajgurunagar Call Girls Just Call 7001035870 [ Cash on Delivery ] Pun...
(PRIYA) Rajgurunagar Call Girls Just Call 7001035870 [ Cash on Delivery ] Pun...(PRIYA) Rajgurunagar Call Girls Just Call 7001035870 [ Cash on Delivery ] Pun...
(PRIYA) Rajgurunagar Call Girls Just Call 7001035870 [ Cash on Delivery ] Pun...ranjana rawat
 
Extrusion Processes and Their Limitations
Extrusion Processes and Their LimitationsExtrusion Processes and Their Limitations
Extrusion Processes and Their Limitations120cr0395
 
chaitra-1.pptx fake news detection using machine learning
chaitra-1.pptx  fake news detection using machine learningchaitra-1.pptx  fake news detection using machine learning
chaitra-1.pptx fake news detection using machine learningmisbanausheenparvam
 
College Call Girls Nashik Nehal 7001305949 Independent Escort Service Nashik
College Call Girls Nashik Nehal 7001305949 Independent Escort Service NashikCollege Call Girls Nashik Nehal 7001305949 Independent Escort Service Nashik
College Call Girls Nashik Nehal 7001305949 Independent Escort Service NashikCall Girls in Nagpur High Profile
 

Recently uploaded (20)

Introduction and different types of Ethernet.pptx
Introduction and different types of Ethernet.pptxIntroduction and different types of Ethernet.pptx
Introduction and different types of Ethernet.pptx
 
Call for Papers - African Journal of Biological Sciences, E-ISSN: 2663-2187, ...
Call for Papers - African Journal of Biological Sciences, E-ISSN: 2663-2187, ...Call for Papers - African Journal of Biological Sciences, E-ISSN: 2663-2187, ...
Call for Papers - African Journal of Biological Sciences, E-ISSN: 2663-2187, ...
 
VIP Call Girls Service Kondapur Hyderabad Call +91-8250192130
VIP Call Girls Service Kondapur Hyderabad Call +91-8250192130VIP Call Girls Service Kondapur Hyderabad Call +91-8250192130
VIP Call Girls Service Kondapur Hyderabad Call +91-8250192130
 
HARMONY IN THE NATURE AND EXISTENCE - Unit-IV
HARMONY IN THE NATURE AND EXISTENCE - Unit-IVHARMONY IN THE NATURE AND EXISTENCE - Unit-IV
HARMONY IN THE NATURE AND EXISTENCE - Unit-IV
 
Call Us -/9953056974- Call Girls In Vikaspuri-/- Delhi NCR
Call Us -/9953056974- Call Girls In Vikaspuri-/- Delhi NCRCall Us -/9953056974- Call Girls In Vikaspuri-/- Delhi NCR
Call Us -/9953056974- Call Girls In Vikaspuri-/- Delhi NCR
 
Sheet Pile Wall Design and Construction: A Practical Guide for Civil Engineer...
Sheet Pile Wall Design and Construction: A Practical Guide for Civil Engineer...Sheet Pile Wall Design and Construction: A Practical Guide for Civil Engineer...
Sheet Pile Wall Design and Construction: A Practical Guide for Civil Engineer...
 
Call Girls Delhi {Jodhpur} 9711199012 high profile service
Call Girls Delhi {Jodhpur} 9711199012 high profile serviceCall Girls Delhi {Jodhpur} 9711199012 high profile service
Call Girls Delhi {Jodhpur} 9711199012 high profile service
 
MANUFACTURING PROCESS-II UNIT-5 NC MACHINE TOOLS
MANUFACTURING PROCESS-II UNIT-5 NC MACHINE TOOLSMANUFACTURING PROCESS-II UNIT-5 NC MACHINE TOOLS
MANUFACTURING PROCESS-II UNIT-5 NC MACHINE TOOLS
 
main PPT.pptx of girls hostel security using rfid
main PPT.pptx of girls hostel security using rfidmain PPT.pptx of girls hostel security using rfid
main PPT.pptx of girls hostel security using rfid
 
Analog to Digital and Digital to Analog Converter
Analog to Digital and Digital to Analog ConverterAnalog to Digital and Digital to Analog Converter
Analog to Digital and Digital to Analog Converter
 
Architect Hassan Khalil Portfolio for 2024
Architect Hassan Khalil Portfolio for 2024Architect Hassan Khalil Portfolio for 2024
Architect Hassan Khalil Portfolio for 2024
 
Call Girls in Nagpur Suman Call 7001035870 Meet With Nagpur Escorts
Call Girls in Nagpur Suman Call 7001035870 Meet With Nagpur EscortsCall Girls in Nagpur Suman Call 7001035870 Meet With Nagpur Escorts
Call Girls in Nagpur Suman Call 7001035870 Meet With Nagpur Escorts
 
Software Development Life Cycle By Team Orange (Dept. of Pharmacy)
Software Development Life Cycle By  Team Orange (Dept. of Pharmacy)Software Development Life Cycle By  Team Orange (Dept. of Pharmacy)
Software Development Life Cycle By Team Orange (Dept. of Pharmacy)
 
(SHREYA) Chakan Call Girls Just Call 7001035870 [ Cash on Delivery ] Pune Esc...
(SHREYA) Chakan Call Girls Just Call 7001035870 [ Cash on Delivery ] Pune Esc...(SHREYA) Chakan Call Girls Just Call 7001035870 [ Cash on Delivery ] Pune Esc...
(SHREYA) Chakan Call Girls Just Call 7001035870 [ Cash on Delivery ] Pune Esc...
 
SPICE PARK APR2024 ( 6,793 SPICE Models )
SPICE PARK APR2024 ( 6,793 SPICE Models )SPICE PARK APR2024 ( 6,793 SPICE Models )
SPICE PARK APR2024 ( 6,793 SPICE Models )
 
Microscopic Analysis of Ceramic Materials.pptx
Microscopic Analysis of Ceramic Materials.pptxMicroscopic Analysis of Ceramic Materials.pptx
Microscopic Analysis of Ceramic Materials.pptx
 
(PRIYA) Rajgurunagar Call Girls Just Call 7001035870 [ Cash on Delivery ] Pun...
(PRIYA) Rajgurunagar Call Girls Just Call 7001035870 [ Cash on Delivery ] Pun...(PRIYA) Rajgurunagar Call Girls Just Call 7001035870 [ Cash on Delivery ] Pun...
(PRIYA) Rajgurunagar Call Girls Just Call 7001035870 [ Cash on Delivery ] Pun...
 
Extrusion Processes and Their Limitations
Extrusion Processes and Their LimitationsExtrusion Processes and Their Limitations
Extrusion Processes and Their Limitations
 
chaitra-1.pptx fake news detection using machine learning
chaitra-1.pptx  fake news detection using machine learningchaitra-1.pptx  fake news detection using machine learning
chaitra-1.pptx fake news detection using machine learning
 
College Call Girls Nashik Nehal 7001305949 Independent Escort Service Nashik
College Call Girls Nashik Nehal 7001305949 Independent Escort Service NashikCollege Call Girls Nashik Nehal 7001305949 Independent Escort Service Nashik
College Call Girls Nashik Nehal 7001305949 Independent Escort Service Nashik
 

Vb.net Experiment with Example

  • 1. Shri Rawatpura Sarkar Institute of Technology-II CSE/7th /VB.NetLab/PreparedbyVivekKumarSinha 1 EXPERIMENT : 1 Aim: Visual basic an introduction of console and GUI programming technique Explain new project window , property explorer , output window dynamic help, window management . The Visual Basic Express Edition integrated development environment (IDE) makes it easy for you to create programs for Microsoft Windows. The IDE contains several tools that help you design your applications and write, edit, and debug your application code. The following links will help you to familiarize yourself with the Visual Basic Express Edition IDE.  Start Page The Start Page may be used to select from the recent projects. A New Project may also be started from the start page by clicking on the New Project Link. This page is useful to search for help in all the Visual Studio Languages. The start page is displayed in the browser & its URL is vs:/default.htm
  • 2. Shri Rawatpura Sarkar Institute of Technology-II CSE/7th /VB.NetLab/PreparedbyVivekKumarSinha 2  Solution Explorer Solution Exploreris the solution directory and helps in managing the open project files. The files are displayed in a hierarchical view. By default, Solution Explorer is located on the right side of the IDE. If Solution Explorer is not visible, it can be made visible by clicking View Menu & then clicking the Solution Explorer.  ToolBox The Toolbox is a container for all the controls that can be added to a Windows Forms application or a Windows Presentation Foundation (WPF) application. By default, theToolbox is located on the left side of the integrated development environment (IDE). If theToolboxis not visible, it can be made visible by clicking View and then clicking ToolBox. The controls in the ToolBox are divided to various groups according to their functionality & usability. The controls are not visible in the ToolBox when you are not in the Code Editor. The Control can be added to the Window Form by dragging it to the Application Window.
  • 3. Shri Rawatpura Sarkar Institute of Technology-II CSE/7th /VB.NetLab/PreparedbyVivekKumarSinha 3 The various categories in which the controls are grouped are: Tab name Description All Windows Forms Contains all the standard Windows Forms controls that are available in theToolbox. Common Controls Contains the most common controls that are typically used in Windows-based applications. Containers Contains controls that hold other controls, such as GroupBox controls and Panel controls. Containers can help isolate a set of controls from other controls on the form. Menus and ToolBars Contains controls that enable you to create menus and toolbars for your application, such as the MenuStrip and ToolStrip controls. Data Contains controls that help you easily work with data in your application, such as the DataGridView control. Components Contains components that typically do not have a user interface, such as the Timer and the ErrorProvider. Printing Contains controls that enable you to provide printing capabilities to an application. Dialogs Contains controls that let you use common dialog boxes in your application, such as the SaveFileDialog, FolderBrowserDialog and FontDialog controls.  Properties Window Properties of a form and any controls on the form in the integrated development environment (IDE) can be set by using the Properties window or by writing code in the Code Editor. For example, to display text on a button, you can set the button's Text property.
  • 4. Shri Rawatpura Sarkar Institute of Technology-II CSE/7th /VB.NetLab/PreparedbyVivekKumarSinha 4 EXPERIMENT : 2 AIM: Write a program to find the average total grade of using if statement in console. Module Module1 Sub Main() Dim sub1, sub2, sub3 As Integer Dim average As Integer Dim name As String Console.Write("Enter Student Name = > ") name = Console.ReadLine() Console.Write("Enter Marks for Subject 1 =>") sub1 = Console.ReadLine() sub1 = Convert.ToInt32(sub1) Console.Write("Enter Marks for Subject 2 =>") sub2 = Console.ReadLine() sub2 = Convert.ToInt32(sub2) Console.Write("Enter Marks for Subject 1 =>") sub3 = Console.ReadLine() sub3 = Convert.ToInt32(sub3) average = (sub1 + sub2 + sub3) / 3 Console.Write("Your Result ") Console.Write("Avergae Marks ") Console.Write(average) Console.Write("") If average < 35 Then Console.Write("Grade B") ElseIf average >= 35 And average < 60 Then Console.Write("Grade A") ElseIf average >= 60 Then Console.Write("Grade A") End If Console.ReadLine()
  • 5. Shri Rawatpura Sarkar Institute of Technology-II CSE/7th /VB.NetLab/PreparedbyVivekKumarSinha 5 End Sub End Module output
  • 6. Shri Rawatpura Sarkar Institute of Technology-II CSE/7th /VB.NetLab/PreparedbyVivekKumarSinha 6 EXPERIMENT NUMNER : 3 AIM: WAP TO ENTER ANY NO BETWEEN 1-7 AND PRINT APPROPREATE DAY AND WEEKS Module Module1 Sub Main() Dim NUM As Integer Console.WriteLine("Enter no between 1-7") NUM = Console.ReadLine() NUM = Convert.ToInt32(NUM) If NUM = 1 Then Console.Write("Sunday") ElseIf NUM = 2 Then Console.Write("Monday") ElseIf NUM = 3 Then Console.Write("Tuesday") ElseIf NUM = 4 Then Console.Write("Wednesay") ElseIf NUM = 5 Then Console.Write("Thursday") ElseIf NUM = 6 Then Console.Write("Friday") ElseIf NUM = 7 Then Console.Write("Saturday") Else Console.Write("Invalid Input") End If Console.ReadLine() End Sub End Module
  • 7. Shri Rawatpura Sarkar Institute of Technology-II CSE/7th /VB.NetLab/PreparedbyVivekKumarSinha 7 OUTPUT
  • 8. Shri Rawatpura Sarkar Institute of Technology-II CSE/7th /VB.NetLab/PreparedbyVivekKumarSinha 8 EXPERIMENT-4 Aim: Write a program to print the following Pattern using for loop. * * * * * * * * * * * * * * * Code: Imports System.Console Module PatternMod Sub Main() Dim n As Integer Write("Enter the number of Rows for the pattern: ") n = ReadLine() For iAs Integer = 0 To n - 1 For j As Integer = 0 To n - i - 1 Write(" ") Next For j = 0 Toi Write("* ") Next WriteLine() Next ReadKey() End Sub End Module OUTPUT
  • 9. Shri Rawatpura Sarkar Institute of Technology-II CSE/7th /VB.NetLab/PreparedbyVivekKumarSinha 9
  • 10. Shri Rawatpura Sarkar Institute of Technology-II CSE/7th /VB.NetLab/PreparedbyVivekKumarSinha 10 EXPERIMENT-5 Aim: Write a program to input numbers in 1D Array & print in Ascending & Descending Order. Code: Imports System.Console Module Arr1DMod Sub Main() Dim Arr() As Integer Dim siz As Integer Write("Enter the size of 1D Array: ") siz = ReadLine() ReDimArr(siz) 'Arr = {3, 6, 2, 4, 1} Dim i, j, choice As Integer WriteLine("Enter the Elements of the Array") For i = 0 Tosiz - 1 Arr(i) = ReadLine() Next Reselect: WriteLine("Select The Order To Display The Result") WriteLine("1. Ascending Order" &vbLf& "2. Descending Order") choice = ReadLine() If choice = 1 Then 'Ascending Order For i = 0 Tosiz - 1 For j = 0 Toi If Arr(i) <Arr(j) Then Dim temp As Integer temp = Arr(i) Arr(i) = Arr(j) Arr(j) = temp End If Next Next ElseIf choice = 2 Then 'Descending Order For i = 0 Tosiz - 1 For j = 0 Toi If Arr(i) >Arr(j) Then Dim temp As Integer temp = Arr(i) Arr(i) = Arr(j) Arr(j) = temp End If Next Next
  • 11. Shri Rawatpura Sarkar Institute of Technology-II CSE/7th /VB.NetLab/PreparedbyVivekKumarSinha 11 Else WriteLine("Wrong Choice!!! Reselect Option!!!") GoTo Reselect End If If choice = 1 Then WriteLine("The Array in Ascending Order is :") Else WriteLine("The Array in Descending Order is :") End If 'Print list For i = 0 Tosiz - 1 WriteLine(Arr(i)) Next ReadKey() End Sub End Module OUTPUT
  • 12. Shri Rawatpura Sarkar Institute of Technology-II CSE/7th /VB.NetLab/PreparedbyVivekKumarSinha 12 EXPERIMENT -6 Aim: Write a program to input numbers in a 2D Array & perform the following operations: i. Sum of all the numbers. ii. Forward Diagonal & Backward Diagonal Matrix. iii. Print Upper Triangular & Lower Triangular Matrix. Code: Imports System.Console Module Array2DMod Dim Arr2D(,) As Integer Dim sizm, sizn As Integer Sub Main() Arr2dEntry() Clear() Arr2dDisp() sumEleArr2D() Clear() Arr2dDisp() FrwdDigArr2D() Clear() Arr2dDisp() BkwdDigArr2D() Clear() Arr2dDisp() LwrTriArr2D() Clear() Arr2dDisp() UprTriArr2D() End Sub Public Sub Arr2dEntry() Dim i, j As Integer WriteLine("Enter the size for the 2D Array:") sizm = ReadLine()
  • 13. Shri Rawatpura Sarkar Institute of Technology-II CSE/7th /VB.NetLab/PreparedbyVivekKumarSinha 13 sizn = ReadLine() ReDimArr2D(sizm, sizn) WriteLine("Enter the " & (sizm * sizn) & " Elements of the Array:") For i = 0 Tosizm - 1 For j = 0 Tosizn - 1 Arr2D(i, j) = ReadLine() 'Integer.Parse(ReadLine()) Next Next End Sub Public Sub Arr2dDisp() WriteLine("The Entered Matrix Is :") WriteLine() Dim i, j As Integer For i = 0 Tosizm - 1 For j = 0 Tosizn - 1 Write(Arr2D(i, j) &vbTab) Next WriteLine(vbLf) Next ReadLine() End Sub Public Sub sumEleArr2D() Dim i, j As Integer Dim sum As Integer For i = 0 Tosizm - 1 For j = 0 Tosizn - 1 sum += Arr2D(i, j) Next Next WriteLine("Sum of the Elements of the 2D Array is : {0}", sum) ReadLine() End Sub Public Sub FrwdDigArr2D() WriteLine("Forward Diagonal Matrix: ") WriteLine() Dim i, j As Integer If sizm = sizn Then
  • 14. Shri Rawatpura Sarkar Institute of Technology-II CSE/7th /VB.NetLab/PreparedbyVivekKumarSinha 14 For i = 0 Tosizm - 1 For j = 0 Tosizn - 1 If i = j Then Write(Arr2D(i, j) &vbTab) Else Write("0" &vbTab) End If Next WriteLine(vbLf) Next Else WriteLine("Forward Diagonal Matrix can only be printed for a triangular Matrix!!! so the Operation is not possible!!!") End If ReadLine() End Sub Public Sub BkwdDigArr2D() WriteLine("Backward Diagonal Matrix: ") WriteLine() Dim i, j As Integer If sizm = sizn Then For i = 0 Tosizm - 1 For j = 0 Tosizn - 1 If i = sizm - j - 1 Then Write(Arr2D(i, j) &vbTab) Else Write("0" &vbTab) End If Next WriteLine(vbLf) Next Else WriteLine("Backward Diagonal Matrix can only be printed for a triangular Matrix!!! so the Operation is not possible!!!") End If ReadLine() End Sub Public Sub LwrTriArr2D() WriteLine("Lower Triangular Matrix: ") WriteLine() Dim i, j As Integer If sizm = sizn Then
  • 15. Shri Rawatpura Sarkar Institute of Technology-II CSE/7th /VB.NetLab/PreparedbyVivekKumarSinha 15 For i = 0 Tosizm - 1 For j = 0 Tosizn - 1 If j <= i Then Write(Arr2D(i, j) &vbTab) Else Write("0" &vbTab) End If Next WriteLine(vbLf) Next Else WriteLine("Lower Triangular Matrix can only be printed for a triangular Matrix!!! so the Operation is not possible!!!") End If ReadLine() End Sub Public Sub UprTriArr2D() WriteLine("Upper Triangular Matrix: ") WriteLine() Dim i, j As Integer If sizm = sizn Then For i = 0 Tosizm - 1 For j = 0 Tosizn - 1 If j >= i Then Write(Arr2D(i, j) &vbTab) Else Write("0" &vbTab) End If Next WriteLine(vbLf) Next Else WriteLine("Upper Triangular Matrix can only be printed for a triangular Matrix!!! so the Operation is not possible!!!") End If ReadLine() End Sub End Module OUTPUT
  • 16. Shri Rawatpura Sarkar Institute of Technology-II CSE/7th /VB.NetLab/PreparedbyVivekKumarSinha 16
  • 17. Shri Rawatpura Sarkar Institute of Technology-II CSE/7th /VB.NetLab/PreparedbyVivekKumarSinha 17
  • 18. Shri Rawatpura Sarkar Institute of Technology-II CSE/7th /VB.NetLab/PreparedbyVivekKumarSinha 18 EXPERIMENT-7 Aim: Write a program to input numbers in a 2D Array & perform the following operations: i. Sum of two matrices. ii. Multiplication of two Matrices. Code: Imports System.Console Module MatrixMod Sub Main() Dim m1(,) As Integer = matInput() Dim m2(,) As Integer = matInput() Dim madd(,) As Integer = matAdd(m1, m2) matOutput(madd) ReadKey() Dim mmul(,) As Integer = matMul(m1, m2) matOutput(mmul) ReadKey() End Sub Public Function matInput() Dim mat(,) As Integer Dim sizm, sizn As Integer WriteLine("Enter the Size of Matrix") Write("size M :") sizm = ReadLine() Write("size N :") sizn = ReadLine() ReDimmat(sizm - 1, sizn - 1) WriteLine("Enter the " &sizm * sizn& " elements of the matrix" &vbLf) Dim i, j As Integer For i = 0 Tosizm - 1 For j = 0 Tosizn - 1 mat(i, j) = ReadLine() Next Next Return mat End Function
  • 19. Shri Rawatpura Sarkar Institute of Technology-II CSE/7th /VB.NetLab/PreparedbyVivekKumarSinha 19 Public Sub matOutput(ByVal mat(,) As Integer) Dim sm, sn As Integer sm = mat.GetUpperBound(0) sn = mat.GetUpperBound(1) WriteLine("The Matrix is ") Dim i, j As Integer For i = 0 Tosm For j = 0 Tosn Write(mat(i, j) &vbTab) Next WriteLine() Next End Sub Public Function matAdd(ByVal m1(,) As Integer, ByVal m2(,) As Integer) Dim mres(,) As Integer Dim ubm1, ubm2, ubn1, ubn2 As Integer ubm1 = m1.GetUpperBound(0) ubm2 = m2.GetUpperBound(0) ubn1 = m1.GetUpperBound(1) ubn2 = m2.GetUpperBound(1) If ubm1 = ubm2 AndAlso ubn1 = ubn2 Then WriteLine("Matrix Addition Possible") ReDimmres(ubm1, ubn1) Dim i, j As Integer For i = 0 To ubm1 For j = 0 To ubn1 mres(i, j) = m1(i, j) + m2(i, j) Next Next Else WriteLine("Addition of Matrix Not Possible!!!") ReadKey() End End If Return mres End Function Public Function matMul(ByVal m1(,) As Integer, ByVal m2(,) As Integer) Dim mres(,) As Integer
  • 20. Shri Rawatpura Sarkar Institute of Technology-II CSE/7th /VB.NetLab/PreparedbyVivekKumarSinha 20 Dim ubm1, ubm2, ubn1, ubn2 As Integer ubm1 = m1.GetUpperBound(0) ubm2 = m2.GetUpperBound(0) ubn1 = m1.GetUpperBound(1) ubn2 = m2.GetUpperBound(1) If ubn1 = ubm2 Then WriteLine("Matrix Multilication Possible") ReDimmres(ubm1, ubn2) Dim i, j, k As Integer For i = 0 To ubm1 For j = 0 To ubn2 For k = 0 To ubn1 mres(i, j) += m1(i, k) * m2(k, j) Next Next Next Else WriteLine("Matrix Multiplication Not Possible") End End If Return mres End Function End Module OUTPUT
  • 21. Shri Rawatpura Sarkar Institute of Technology-II CSE/7th /VB.NetLab/PreparedbyVivekKumarSinha 21
  • 22. Shri Rawatpura Sarkar Institute of Technology-II CSE/7th /VB.NetLab/PreparedbyVivekKumarSinha 22 EXPERIMENT : 8 AIM: WAP TO ENTER NO BETWEEN 1-12 AND DISPLAY APPROPRIAT MONTH NAME. Module Module1 Sub Main() Dim NUM As Integer Console.WriteLine("Enter no between 1-12") NUM = Console.ReadLine() NUM = Convert.ToInt32(NUM) If NUM = 1 Then Console.Write("Janvery") ElseIf NUM = 2 Then Console.Write("Febvary") ElseIf NUM = 3 Then Console.Write("March") ElseIf NUM = 4 Then Console.Write("April") ElseIf NUM = 5 Then Console.Write("May") ElseIf NUM = 6 Then Console.Write("June") ElseIf NUM = 7 Then Console.Write("July") ElseIf NUM = 8 Then Console.Write("Augst") ElseIf NUM = 9 Then Console.Write("September") ElseIf NUM = 10 Then Console.Write("October") ElseIf NUM = 11 Then Console.Write("November") ElseIf NUM = 12 Then Console.Write("December") Else
  • 23. Shri Rawatpura Sarkar Institute of Technology-II CSE/7th /VB.NetLab/PreparedbyVivekKumarSinha 23 Console.Write("Invalid Input") End If Console.ReadLine() End Sub End Module Output:
  • 24. Shri Rawatpura Sarkar Institute of Technology-II CSE/7th /VB.NetLab/PreparedbyVivekKumarSinha 24
  • 25. Shri Rawatpura Sarkar Institute of Technology-II CSE/7th /VB.NetLab/PreparedbyVivekKumarSinha 25