Sei sulla pagina 1di 28

PRATICAL-1 AIM::Implement Arithmetic Calculator Using Console PROGRAM ::

Sub Main() Dim i, j As Integer System.Console.WriteLine("Enter First Integer:") i = Console.ReadLine() System.Console.WriteLine("Enter Second Integer:") j = Console.ReadLine() Console.WriteLine("Result of Addition is:" & (i + j)) Console.WriteLine("Result of Subtraction is:" & (i - j)) Console.WriteLine("Result of Mulptiplication is:" & (i * j)) Console.WriteLine("Result of division is:" & (i \ j)) Console.Read() End Sub

RUN::
DISPLAY ON THE SCREEN ::

INPUT ::

OUTPUT ::

PRATICAL-2 AIM::Develop a Program to Produce Grade Sheet Using Console PROGRAM ::


Sub Main() Dim marks1, marks2, marks3, marks4, marks5 As Integer Dim Sum As Integer Dim Average As Double Console.WriteLine("Please enter a subject of marks1") marks1 = Convert.ToDouble(Console.ReadLine()) Console.WriteLine("Please enter a subject of marks2") marks2 = Convert.ToDouble(Console.ReadLine()) Console.WriteLine("Please enter a subject of marks3") marks3 = Convert.ToDouble(Console.ReadLine()) Console.WriteLine("Please enter a subject of marks4") marks4 = Convert.ToDouble(Console.ReadLine()) Console.WriteLine("Please enter a subject of marks5") marks5 = Convert.ToDouble(Console.ReadLine()) Sum = marks1 + marks2 + marks3 + marks4 + marks5 Console.WriteLine("Sum of Marks = " & Sum) Average = Sum / 5 Console.WriteLine("Average Of Marks=" & Average) If Average >= 90 Then Console.WriteLine("Grade is an A!") ElseIf Average >= 80 And Average < 90 Then Console.WriteLine("Grade is an B!") ElseIf Average >= 70 And Average < 80 Then Console.WriteLine("Grade is a C!") ElseIf Average >= 60 And Average < 70 Then Console.WriteLine("Grade is a D!") ElseIf Average < 60 Then Console.WriteLine("Grade is an F!") End If Console.Read() End Sub

RUN::
DISPLAY ON THE SCREEN ::

INPUT ::

OUTPUT ::

PRATICAL-3 AIM::Develop a Program To Check given number is Prime or not


Using Console

PROGRAM ::
Sub Main() Dim i, j As Integer Dim t As Boolean Console.WriteLine("Enter Number") i = Console.ReadLine() t = True For j = 2 To (i - 1) If i Mod j = 0 Then t = False Exit For End If Next j If t Then Console.WriteLine(i & " is a prime Number") Console.ReadLine() Else Console.WriteLine(i & " is not a prime Number") Console.ReadLine() End If End Sub

RUN::
DISPLAY ON THE SCREEN ::

INPUT ::

OUTPUT ::

PRATICAL-4 AIM::Develop a Program To Print Fibonacci Series Using Console PROGRAM ::


Sub Main() Dim n1 As Integer Dim n2 As Integer n1 = 1 n2 = 1 Console.WriteLine("Print Fibonacci Series Up to 30 no") Console.WriteLine("{0}", n1) While n2 < 30 Console.WriteLine(n2) n2 = n2 + n1 n1 = n2 - n1 End While Console.ReadLine() End Sub

RUN::
DISPLAY ON THE SCREEN ::

INPUT ::

OUTPUT ::

PRATICAL-5 AIM::Develop a Program To Check given number is palindrome or not


Using Console

PROGRAM ::
Sub Main() Dim n, temp, i, rev As Long Console.Write("Enter the mumber : ") n = Console.ReadLine() temp = n While (n > 0) i = n Mod 10 n \= 10 rev = (rev * 10) + i End While If (rev = temp) Then Console.WriteLine(temp & " is PALINDROM.") Else Console.WriteLine(temp & " is not PALINDROM.") End If Console.ReadLine() End Sub

RUN::
DISPLAY ON THE SCREEN ::

INPUT ::

OUTPUT ::

PRATICAL-6 AIM::Develop a Program To Factorial of a number using function


Using Console

PROGRAM ::
Imports System.Console Module Module1 Sub Main() Console.Write("Factorial of : ") Dim i As Integer = Integer.Parse(Console.ReadLine()) Console.WriteLine("Factorial of " + i.ToString + ": " + GetFactorial(i).ToString) Console.ReadKey() End Sub Function GetFactorial(ByVal value As Integer) As Integer Dim retValue As Integer = 1 Dim i As Integer For i = 2 To value retValue *= i Next Return retValue End Function End Module

RUN::
DISPLAY ON THE SCREEN ::

INPUT ::

OUTPUT ::

PRATICAL-7 AIM::Create form to demonstrate use of methods and properties of


array

PROGRAM ::
Public Class Form1 Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click Dim i As Integer Dim week(6) As String week(0) = "Sunday" week(1) = "Monday" week(2) = "Tuesday" week(3) = "Wednesday" week(4) = "Thursday" week(5) = "Friday" week(6) = "Saturday" For i = 0 To week.Length - 1 MsgBox(week(i)) Next End Sub Private Sub Button2_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button2.Click Dim i As Integer Dim ItemList As New ArrayList() ItemList.Add("Ramesh") ItemList.Add("Suresh") ItemList.Add("Jayesh") ItemList.Add("Hardik") ItemList.Add("Vrinda") MsgBox("Shows Added Items") 'MsgBox(ItemList.Count()) For i = 0 To ItemList.Count - 1 MsgBox(ItemList.Item(i)) Next 'insert an item ItemList.Insert(3, "hina") 'sort itemms in an arraylist

ItemList.Sort() 'remove an item ItemList.Remove("Ramesh") 'remove item from a specified index ItemList.RemoveAt(3) MsgBox("Shows final Items the ArrayList") For i = 0 To ItemList.Count - 1 MsgBox(ItemList.Item(i)) Next End Sub End Class

RUN::
DISPLAY ON THE SCREEN ::

INPUT :: OUTPUT ::

PRATICAL-8 AIM::Display message using Textbox, Label, Button Control PROGRAM ::


Public Class Form1 Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click MsgBox("Welcome " & TextBox1.Text & "This is Your First VB.NET Windows application") End Sub End Class

RUN::
DISPLAY ON THE SCREEN ::

INPUT ::

OUTPUT ::

PRATICAL-9 AIM::Implement Simple text pad to perform


undo,redo,cut,copy,paste,select all,find,replace,loadfile,savefile operations using richtextbox

PROGRAM :: RUN::
DISPLAY ON THE SCREEN :: INPUT :: OUTPUT ::

PRATICAL-10 AIM::Create Employee registration form to collect details (using radio


button, checkbox and other controls)

PROGRAM :: RUN::
DISPLAY ON THE SCREEN :: INPUT :: OUTPUT ::

PRATICAL-11 AIM::Create form to select hobbies and nationality using checkbox,


radio button

PROGRAM :: RUN::
DISPLAY ON THE SCREEN :: INPUT :: OUTPUT ::

PRATICAL-6 AIM::Develop a Program To Factorial of a number using function


Using Console

PROGRAM :: RUN::
DISPLAY ON THE SCREEN :: INPUT :: OUTPUT ::

PRATICAL-6 AIM::Develop a Program To Factorial of a number using function


Using Console

PROGRAM :: RUN::
DISPLAY ON THE SCREEN :: INPUT :: OUTPUT ::

PRATICAL-6 AIM::Develop a Program To Factorial of a number using function


Using Console

PROGRAM :: RUN::
DISPLAY ON THE SCREEN :: INPUT :: OUTPUT ::

PRATICAL-6 AIM::Develop a Program To Factorial of a number using function


Using Console

PROGRAM :: RUN::
DISPLAY ON THE SCREEN :: INPUT :: OUTPUT ::

PRATICAL-6 AIM::Develop a Program To Factorial of a number using function


Using Console

PROGRAM :: RUN::
DISPLAY ON THE SCREEN :: INPUT :: OUTPUT ::

PRATICAL-6 AIM::Develop a Program To Factorial of a number using function


Using Console

PROGRAM :: RUN::
DISPLAY ON THE SCREEN :: INPUT :: OUTPUT ::

Potrebbero piacerti anche