Aman2
Aman2
Practical Assignment
On
“Dot Net Technology Lab”
Submitted To:
GD RUNGTA COLLEGE OF SCIENCE & TECHNOLOGY,
BHILAI (C.G)
Practical No:-01
Aim:- Write A Program To Find Maximum Between Three Numbers.
Form Design:-
Code:-
Public Class Form1
Dim A As Integer
Dim B As Integer
Dim C As Integer
Dim D As Integer
Private Sub Button1_Click(sender As Object, e As EventArgs) Handles
Button1.Click
TextBox6.Text = ""
TextBox7.Text = ""
TextBox5.Text = ""
TextBox8.Text = ""
End Sub
Private Sub Button2_Click(sender As Object, e As EventArgs) Handles
Button2.Click
A = Val(TextBox7.Text)
B = Val(TextBox6.Text)
C = Val(TextBox5.Text)
If (A > B) Then
If (B > C) Then
TextBox8.Text = A
End If
ElseIf (B > C) Then
TextBox8.Text = B
Else
TextBox8.Text = C
End If
End Sub
Private Sub Button3_Click(sender As Object, e As EventArgs) Handles
Button3.Click
Close()
End Sub
End Class
OUTPUT
Practical No:-02
Form Design:-
Code:-
Public Class Form1
Dim A As Integer
Dim B As String
Private Sub Button1_Click(sender As Object, e As EventArgs) Handles
Button1.Click
TextBox7.Text = ""
TextBox4.Text = ""
End Sub
Private Sub Button2_Click(sender As Object, e As EventArgs) Handles
Button2.Click
A = Val(TextBox7.Text)
If (A < 0) Then
B = "Number Is Negative"
TextBox4.Text = B
ElseIf (A = 0) Then
B = "Number Is Zero"
TextBox4.Text = B
Else
B = "Number Is Positive"
TextBox4.Text = B
End If
End Sub
Private Sub Button3_Click(sender As Object, e As EventArgs) Handles
Button3.Click
Close()
End Sub
End Class
OUTPUT:-
Practical No:-03
Form Design:-
Code:-
Public Class Form1
Dim A As Char
Private Sub Button1_Click(sender As Object, e As EventArgs) Handles
Button1.Click
TextBox4.Text = ""
TextBox7.Text = ""
End Sub
OUTPUT:-
Practical No:-04
Aim:- Design An Application To Input Marks Of Five Subjects:-
Physics, Chemistry, Biology, Mathematics And Computer.
Calculate Percentage And Grade.
Percentage>90%:Grade A
Percentage>=80%:Grade B
Percentage>70%:Grade C
Percentage>60%:Grade D
Percentage>=40%:Grade E
Percentage<40%:Grade F
Form Design:-
Code:-
Public Class Form1
Dim A, B, C, D, K, T, p As Integer
Private Sub Button1_Click(sender As Object, e As EventArgs) Handles
Button1.Click
TextBox3.Text = ""
TextBox5.Text = ""
TextBox7.Text = ""
TextBox9.Text = ""
TextBox11.Text = ""
TextBox13.Text = ""
TextBox15.Text = ""
End Sub
Private Sub Button2_Click(sender As Object, e As EventArgs) Handles
Button2.Click
A = Val(TextBox3.Text)
B = Val(TextBox5.Text)
C = Val(TextBox7.Text)
D = Val(TextBox9.Text)
K = Val(TextBox11.Text)
T = (A + B + C + D + K)
TextBox17.Text = T
p = (A + B + C + D + K) / 500 * 100
TextBox13.Text = p
If (p <= 100) And (p >= 90) Then
TextBox15.Text = "A"
ElseIf (p < 90) And (p >= 80) Then
TextBox15.Text = "B"
ElseIf (p < 80) And (p >= 70) Then
TextBox15.Text = "C"
ElseIf (p < 70) And (p >= 60) Then
TextBox15.Text = "D"
ElseIf (p < 60) And (p >= 40) Then
TextBox15.Text = "E"
ElseIf (p < 40) Then
TextBox15.Text = "F"
Else
TextBox15.Text = "Invalid Grade"
End If
End Sub
Private Sub Button3_Click(sender As Object, e As EventArgs) Handles
Button3.Click
Close()
End Sub
End Class
OUTPUT:-
Practical No:-05
Aim:- Design an application to input basic salary of an employee
and calculate its gross salary following:
Basic Salary <= 10000: HRA = 20%, DA = B0%
Basic Salary <n20000: HRA = 25%, DA = 90%
Basic Salary > 20000 : HRA = 30%, DA = 95%
Form Design:-
Code:-
Public Class Form1
Dim a, b, c As String
Dim gs, da, hra As Integer
Private Sub Button1_Click(sender As Object, e As EventArgs) Handles
Button1.Click
TextBox3.Text = ""
TextBox5.Text = ""
TextBox7.Text = ""
TextBox9.Text = ""
TextBox16.Text = ""
TextBox17.Text = ""
TextBox18.Text = ""
TextBox19.Text = ""
TextBox20.Text = ""
TextBox21.Text = ""
TextBox22.Text = ""
End Sub
Private Sub Button2_Click(sender As Object, e As EventArgs) Handles
Button2.Click
a = (TextBox9.Text)
TextBox5.Text = a
b = (TextBox3.Text)
TextBox20.Text = b
c = (TextBox7.Text)
TextBox19.Text = c
End Sub
Private Sub Button3_Click(sender As Object, e As EventArgs) Handles
Button3.Click
Close()
End Sub
End Class
OUTPUT:-
Practical No:-06
Aim:- Design an application to input electricity unit charges and
calculate the given condition:
For first 50 units Rs. 0.50/unit
For next 100 units Rs. 0.75/unit
For next 100 units Rs. 1.20/unit
For unit above 250 Rs. 1.50/unit
An additional surcharge of 20% is added to the bill
Form Design:-
Code:-
Public Class Form1
Dim a, b, c As Double
Private Sub Button1_Click(sender As Object, e As EventArgs) Handles
Button1.Click
TextBox4.Text = ""
TextBox6.Text = ""
End Sub
Private Sub Button2_Click(sender As Object, e As EventArgs) Handles
Button2.Click
a = Val(TextBox6.Text)
If a < 51 And a > 0 Then
b = a * 0.5
c = (b * 20 / 100) + b
TextBox4.Text = c
ElseIf a > 50 And a < 151 Then
b = a * 0.75
c = (b * 20 / 100) + b
TextBox4.Text = c
ElseIf a > 150 And a < 251 Then
b = a * 1.2
c = (b * 20 / 100) + b
TextBox4.Text = c
ElseIf a > 250 Then
b = a * 1.5
c = (b * 20 / 100) + b
TextBox4.Text = c
End If
End Sub
Private Sub Button3_Click(sender As Object, e As EventArgs) Handles
Button3.Click
Close()
End Sub
End Class
OUTPUT:-