Professional Documents
Culture Documents
PROGRAM:-
Const Pi=3.14159
radius= Val(Text1.Text)
End Sub
End
End Sub
S.No. Control Properties Value
1. Label 1 Caption Enter the radius
PROGRAM:-
Private Sub cmdsum_Click()
Num1= val(text1.text)
Num2= val(text2.text)
Sum = num1+num2
End sub
Num1= val(text1.text)
Num2= val(text2.text)
divison = num1/num2
End sub
num1= val(text1.text)
num2= val(text2.text)
multi = num1*num2
End sub
num1= val(text1.text)
num2= val(text2.text)
difference = num1-num2
End sub
End
End sub
S.No. Control Properties Value
Caption SUBTRACT
8. Command 3 (Name) cmdmul
Caption MULTIPLY
9. Command 4 (Name) cmddiv
Caption DIVIDE
ASSIGNMENT -3
AIM: -Design an application that find largest of three numbers
PROGRAM: -
Private Sub cmdlar_Click()
Dim n1 As Single
Dim n2 As Single
Dim n3 As Single
n1= Val(Text1.Text)
n2= Val(Text2.Text)
n3= Val(Text3.Text)
largest = n1
largest = n2
Elselargest = n3
End If
End Sub
End
End Sub
S.No. Control Properties Value
PROGRAM:-
Private Sub cmdcheck_Click()
Dim n As Integer
n = Val(Text1.Text)
If n Mod 2 = 0 Then
MsgBox ("Even")
Else
MsgBox ("odd")
End If
End Sub
End
End Sub
S.No. Control Properties Value
<=2000 200
>4000 500
PROGRAM:-
Private Sub cmdhra_Click ()
HRA = 200
HRA = 350
HRA = 500
Else
End If
End Sub
End
End Sub
S.No Control Properties Value
PROGRAM:-
Private Sub Command1_Click ()
rnum = 0
num = Text1.Text
temp = num
Do
temp = temp \ 10
Else
End If
End Sub
Private Sub Command2_Click ()
End
End Sub
S.No. Control Properties Value
PROGRAM:-
Private Sub Command1_Click()
List1.Clear
Dim n As Integer
n=0
Do While n < 10
n=n+1
r = Val(Text1.Text) * n
Loop
Text1.SetFocus
End Sub
S.No. Control Properties Value
PROGRAM:-
Private Sub cmdsum_Click()
Dim x As Single
Dim n, i As Integer
fact = 1
x= Val(Text1.Text)
n= Val(Text2.Text)
term=x Sum x
For i = 1 To n
term=term*x*x
fact-fact (2i+1)* (2 * i)
End Sub
End
End Sub
S.No. Control Properties Value
INCOME TAX
up to 1,0000 0
PROGRAM:-
Private Sub Command1_Click()
income = Val(Text1.Text)
tax = 0
Else
End If
MsgBox ("tax is" & tax)
End Sub
End
End Sub
S.No. Control Properties Value
PROGRAM:-
Dim n As Integer
Dim i As Integer
sum = 0
For i = 1 To n
Print " number " & i & " is " & num(i)
Next
mean = sum / n
End
End Sub
S.No. Control Property Value
PROGRAM:-
Private Sub Command1_Click ()
Dim x As Single
x = Val (Text1.Text)
Select Case x
Case 1 To 10
price = x * 120
Case 11 To 20
price = x * 110
Case 21 To 25
price = x * 100
Case 26 To 30
price = x * 90
Case 31 To 50
price = x * 80
Case Else
price = x * 70
End Select
End Sub
Dim x As Single
x = Val (Text1.Text)
Select Case x
Case 1 To 10
price = x * 100
Case 11 To 20
price = x * 90
Case 21 To 25
price = x * 80
Case 26 To 30
price = x * 70
Case 31 To 50
price = x * 60
Case Else
price = x * 50
End Select
End Sub
End
End Sub
S.No. Control Properties Value
PROGRAM:-
Dim n As Integer
For i = 1 To n
Next
For i = 1 To n
For j = 1 To n-1
num (j + 1) = temp
End If
Next
Next
For i = 1 To n
Print num(i);
Next
End Sub
End
End Sub
S.No Control Property Value
PROGRAM:-
Dim a (1 To 5, 1 To 5) As Integer.
Dim b (1 To 5, 1 To 5) As Integer
Dim s (1 To 5, 1 To 5) As Integer
For i= 1 To m
For j= 1 To n
a (i, j) = Val (InputBox(" Enter Element Row#" & i & "Column#” & j))
Next
Next
Print
For i= 1 To m
For j= 1 To n
b (i, j) = Val (Input Box (" Enter Element Row#" & i & "Column#" & j ))
Next Print
Next
For i = 1 To m
For j = 1 To n
Next Next
For i = 1 To m
For j= 1 To n
Next Print
Next
End Sub
End
End Sub
PROGRAM:-
op1 = Val(Text1.Text)
End Sub
op2 = op1
op1 = 0
operator = Command3(Index).Caption
End Sub
Private Sub Command4_Click()
Case "+"
Text1.Text = result
Case "-"
Text1.Text = result
Case "*"
Text1.Text = result
Case "/"
Text1.Text = result
End Select
op1 = result
End Sub
Text1.Text = Val(Sqr(op1))
End Sub
op2 = 0
op1 = 0
End Sub
op1 = 0
End Sub
S.No. Control Properties Value
Program:
Private Sub cmdok_Click()
MsgBox ("Password,OK")
Else
End If
End Sub
End
End Sub
S.No. Control Properties Value
Clipboard.SetText Text1.SelText
Command2.Enabled = True
End Sub
Clipboard.SetText Text1.SelText
Text1.SelText = ""
Command1.Enabled = True
End Sub
Text1.SelText = Clipboard.GetText
End Sub
Text1.SelStart = 0
Text1.SelLength = Len(Text1.Text)
Text1.SetFocus
End Sub
End
End Sub
S.No. Control Property Value