Professional Documents
Culture Documents
Dot Net Project 1
Dot Net Project 1
ASSIGNMENT
ON
Guided by Submitted by
Mrs. KAVITA BHARTI LAKSHYA PATEL
CLASS – BCA lll
Submitted to
Durga College
Pt. Ravishanker Shukla University Raipur ( C . G )
ACKNOWLEDGEMENT
Design :-
Code :-
Public Class Form1
Dim a As Integer
Dim b As Integer
Dim c As Integer
a = Val(TextBox1.Text)
b = Val(TextBox2.Text)
c = Val(TextBox3.Text)
End Sub
End Class
Output :-
Design :-
Code :-
Public Class Form1
Dim a As Integer = 1
a = Val(TextBox1.Text)
If 0 < a Then
Label1.Text = " Positive Number "
ElseIf 0 > a Then
Label1.Text = " Negative Number "
ElseIf 0 = 0 Then
Label1.Text = " Integer / Zero "
End If
End Sub
End Class
Outputs :-
Q3. Write a Program to check whether a year is leap year or not.
Design :-
Code :-
Public Class Form1
Dim L As Integer
L = Val(TextBox1.Text)
End Sub
End Class
Outputs :-
Code :-
Public Class Form1
Phy = Val(TextBox1.Text)
Chem = Val(TextBox2.Text)
Bio = Val(TextBox3.Text)
Maths = Val(TextBox4.Text)
Comp = Val(TextBox5.Text)
Q5. Design an Application to input basic salary of an employee and calculate its
Gross salary according to following :
Design :-
Code :-
Public Class Form1
sal = Val(TextBox1.Text)
gs = sal + da + hra
TextBox2.Text = da
TextBox3.Text = hra
TextBox4.Text = gs
End Sub
End Class
Output :-
Design :-
Code :-
Public Class Form1
Dim x, y As Integer
x = Val(TextBox1.Text)
y = Val(TextBox2.Text)
x = x Xor y
y = x Xor y
x = x Xor y
End Sub
End Class
Output :-
Design :-
Code :-
Public Class Form1
Dim a, b As Integer
Dim Sign As String
Dim Cal As Single
a = Val(TextBox1.Text)
b = Val(TextBox2.Text)
Sign = Val(TextBox3.Text)
TextBox4.Text = Cal
End Sub
End Class
Outputs :-
Q8. Write a Program to find sum of all natural numbers between 1 to n.
Design :-
Code :-
Public Class Form1
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As
System.EventArgs) Handles Button1.Click
Dim n, sum As Integer
n = Val(TextBox1.Text)
sum = (n * (n + 1)) / 2
TextBox2.Text = sum
End Sub
End Class
Output :-
Q9. Write a program to find first and last digit of any number .
Design :-
Code :-
Public Class Form1
n = Val(TextBox1.Text)
First = n
First = First / 10
End While
Last = n Mod 10
TextBox2.Text = First
TextBox3.Text = Last
End Sub
End Class
Output :-
Q10. Write a program to enter any number and print its reverse .
Design :-
Code :-
Public Class Form1
Dim n, a As Integer
Dim length As Integer
n = CInt(TextBox1.Text)
length = TextBox1.TextLength
For i = 1 To length
a = n Mod 10
n = n \ 10
TextBox2.Text = TextBox2.Text & a
Next
End Sub
End Class
Output :-
Q11. Write a program to enter any number and check whether the number is
palindrome or not.
Design:-
Code:-
Public Class Form1
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As
System.EventArgs) Handles Button1.Click
Dim n
Dim r
Dim sum = 0
Dim temp
n = Val(TextBox1.Text)
temp = n
While (n > 0)
r = n Mod 10
sum = sum * 10 + r
n = Math.Floor(n / 10)
End While
End Sub
End Class
Outputs:-
Q12. Write a program to check whether a number is Armstrong
number or not.
Design:-
Code:-
Public Class Form1
Dim n As Integer
Dim r As Integer
Dim sum As Integer
Dim t As Integer
n = Val(TextBox1.Text)
sum = 0
t = n
While n > 0
r = n Mod 10
sum = sum + r ^ 3
n = n \ 10
End While
If sum = t Then
Label1.Text = "It is Armstrong Number "
Else
Label1.Text = "It is not Armstrong Number "
End If
End Sub
End Class
Outputs:-
Design:-
Code:-
Public Class Form1
x = 1
y = Val(TextBox1.Text)
y = y + 2
Do Until x >= y
z = 1
TextBox2.Text = TextBox2.Text & Space(y - x)
Do Until z >= x
TextBox2.Text = TextBox2.Text & " " & "*" & " " & " "
z += 1
Loop
TextBox2.Text = TextBox2.Text & vbCrLf
x += 1
Loop
End Sub
TextBox2.Clear()
End Sub
End Class
Output:-
Code:-
Timer1.Enabled = True
End Sub
End Sub
End Class
Output:-
Q15. Design an application that accepts the item name from
the user and add it to a listbox and combobox.
Design:-
Code:-
Public Class Form1
Output:-
Design:-
Code:-
Public Class Form1
Dim t As Integer
Dim c As Single
t = Val(TextBox1.Text)
c = (t * 9 / 5) + 32
TextBox2.Text = c
End Sub
Dim f As Single
t = Val(TextBox1.Text)
f = (t - 32) * 5 / 9
TextBox2.Text = f
End Sub
End Class
Outputs:-
Q17. WAP to launch a rocket using PictureBox and Timer
Control.
Design:-
Code:-
PictureBox1.Top = PictureBox1.Top - 1
End Sub
Timer1.Enabled = True
End Sub
Timer1.Enabled = False
End Sub
End Class
Output:-
Q18. WAP to change the back color of any control using
scrollbar.
Design:-
Code:-
Public Class Form1
End Sub
End Class
Outputs:-
Red: Green:
Blue: Purple:
Code:-
n = Val(TextBox1.Text)
sqr = n * n
If sum = n Then
Label2.Text = " It is a Neon Number "
Else
Label2.Text = " It is not a Neon Number "
End If
End Sub
End Class
Outputs:-
Q20. WAP to check whether a given number is duck number or
not.
Design:-
Code:-
Public Class Form1
n = Val(TextBox1.Text)
r = 0
While n <> 0
i = n Mod 10
If i = 0 Then
r = r + 1
End If
n = n \ 10
End While
If r >= 1 Then
Label2.Text = " It is duck number "
Else
Label2.Text = " It is not duck number "
End If
End Sub
End Class
Outputs:-
Q21. Design the following application using radiobutton and
checkbox.
Design:-
Code:-
Label2.Text = " You Selected a " & pr & " with " & os & " And Accesories : " &
ac1 & ac2 & ac3 & ac4
End Sub
RadioButton1.Checked = False
RadioButton2.Checked = False
RadioButton3.Checked = False
RadioButton4.Checked = False
RadioButton5.Checked = False
CheckBox1.Checked = False
CheckBox2.Checked = False
CheckBox3.Checked = False
CheckBox4.Checked = False
End Sub
Private Sub Button3_Click(ByVal sender As System.Object, ByVal e As System.EventArgs)
Handles Button3.Click
End
End Sub
End Class
Output:-
Code:-
Dim hw As Single
Dim da As Single
Dim R As Single
Dim gs As Single
Dim ns As Single
hw = Val(TextBox2.Text)
da = Val(TextBox3.Text)
End Sub
TextBox1.Text = ""
TextBox2.Text = ""
TextBox3.Text = ""
TextBox4.Text = ""
TextBox5.Text = ""
RadioButton1.Checked = False
RadioButton2.Checked = False
RadioButton3.Checked = False
End Sub
End
End Sub
End Class
Output:-
Q23. Design an application for facilitating purchasing order.
Design:-
Code:-
Dim a As Integer
Dim b As Integer
Dim c As Integer
Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs)
Handles MyBase.Load
ComboBox2.Items.Add("Black")
ComboBox2.Items.Add("White")
ListBox1.Items.Add("Sedan")
ListBox1.Items.Add("Hatch Back")
End Sub
TextBox1.Text = a + b + c
End Sub
TextBox1.Text = ""
End Sub
End Class
Output:-
Design:-
Code:-
T = Val(TextBox1.Text)
C = Val(TextBox2.Text)
Rt = 20
Rc = 30
End Sub
Private Sub Button2_Click(ByVal sender As System.Object, ByVal e
As System.EventArgs) Handles Button2.Click
End
End Sub
End Class
Outputs:-
Code:-
Public Class Form1
user = TextBox1.Text
pass = TextBox2.Text