Computer Fundamental - I Practical File
Computer Fundamental - I Practical File
Computer Fundamental - I Practical File
Practical File
Computer Fundamental - I
3rd Semester
Submitted By:
Submitted To:
Name: Kamod
NIRAJ KUMAR SAHU
Thakur
Assistant Professor (CSE)
Enrollment
no:2101BBA959765
Computer Fundamental - I
List of Experiments
DATE OF DATE OF
S.N. NAME OF THE PROGRAM
EXPERIMENT SUBMISSION
Exercise on opening projects like standard
1 04.09.2021 04.09.2021
Exe, Active-X EXE and Active-Xcontrol
2 Exercise on add two number in VB 04.09.2021 04.09.2021
2
Computer Fundamental - I
OUTPUT:
3
Computer Fundamental - I
Before doing coding for adding two number you have to create user user
interface .IN which you need 3label, 2text boxes, 1command button. And
the user interface look like this.
You can also design user interface as you want but code should be right
otherwise the program will not work properly.
4
Computer Fundamental - I
End Sub
OUTPUT:
5
Computer Fundamental - I
Before doing coding for Dividing two number You have to create user user
interface .IN which you need 3label, 2text boxes,1command button. And
the user interface look like this.
You can also design user interface as you want but code should be right
otherwise the program will not work properly.
End Sub
6
Computer Fundamental - I
OUTPUT:
7
Computer Fundamental - I
Before doing coding for IF then ELSE. You have to create user user interface
.IN which you need 2label, 2text boxes,1.And the user interface look like this
Consider the following example code, the program has a variable calledday.Iftheday is1,itis
Monday,elseitisTuesday,andsoon.
day =
Val(Text1.Text) If
day = 1 Then
Text2.Text = "Monday"
Text2.Text = "Tuesday"
8
Computer Fundamental - I
Text2.Text =
= 4 Then
Text2.Text =
= 5 Then Text2.Text =
6 Then Text2.Text =
= 7 Then Text2.Text =
"Sunday" Else
To 7" End If
End Sub
If the number for variable day is greater than 7 , then default message is displayed – "Enter number less than equal to 7".
9
Computer Fundamental - I
OUTPUT:
10
Computer Fundamental - I
Before doing coding for Swich function.You have to create user interface .IN
which you need 1command button. And the user interface look like this
Result = Switch(number < 100, "Number is Less than 100", number >=
100, "Number is Greater than Equal to 100")
MsgBox (Result)
End Sub
11
Computer Fundamental - I
OUTPUT:
12
Computer Fundamental - I
Before doing coding for loop. You have to create form .IN which you
need 1command button. And the form look like this.
For index = 1 To 15
sum = sum + 10
Next index
End Sub
OUTPUT:
14
Computer Fundamental - I
Before doing coding for each loop. You have to create form .IN which you
need 1command button. And the form look like this.
NumArray(0) = "Ram"
NumArray(1) = "Jaya"
NumArray(2) = "Bruce"
MsgBox (ArrayItem)
Next ArrayItem
End Sub
OUTPUT:
15
Computer Fundamental - I
16
Computer Fundamental - I
8) Exercise on do loop.
Before doing coding for do loop. You have to create form .IN which you
need 1command button. And the form look like this.
sum = 0
i=0
Do Until i = 100
sum = sum + i
i=i+1
Loop
17
Computer Fundamental - I
End Sub
OUTPUT:
18
Computer Fundamental - I
For firstCounter = 1 To 5
Print "Hello"
For secondCounter = 1 To 4
Print "Welcome to the VB tutorial"
Next secondCounter
Next firstCounter
Print "Thank you"
End Sub
19
Computer Fundamental - I
OUTPUT:
20
Computer Fundamental - I
Before doing coding for abs () function.You have to create form .IN which you
need 1command button and one text box for input.And the form look like this.
Absolute = Abs(Val(Text1.Text))
MsgBox ("The Absolute value is" & " " & Absolute)
End Sub
21
Computer Fundamental - I
OUTPUT:
22
Computer Fundamental - I
Before doing coding for Cos function.You have to create form .IN which you
need 1command button and one text box for input.And the form look like this.
Command1_Click() Dim
Cosine As Double
Cosine = Cos(Val(Text1.Text))
23
Computer Fundamental - I
24
Computer Fundamental - I
Before doing coding for Exp function.You have to create form .IN which you
need 1command button and one text box for input.And the form look like this.
result = Exp(Val(Text1.Text))
MsgBox (result)
End Sub
25
Computer Fundamental - I
26
Computer Fundamental - I
Before doing coding for sqr function.You have to create form .IN which you
need 1command button and one text box for input.And the form look like this.
27
Computer Fundamental - I
result = Sqr(Val(Text1.Text))
MsgBox (result)
End Sub
28
Computer Fundamental - I
Num = Val(Text1.Text)
Result = Log(Num)
Text2.Text = Str(Result)
29
Computer Fundamental - I
End Sub
Private Sub
Command2_Click()
Text1.Text = ""
Text2.Text =
"" End Sub
30
Computer Fundamental - I
End Sub
Private Sub Command2_Click()
Text2.Text = LCase(Text1.Text)
End Sub
31
Computer Fundamental - I
32