Null 1
Null 1
SEMESTER VI
PROGRAMMING IN VB
1. Construction of an Arithmetic Calculator (Simple)
2. Writing simple programs using loops and decision making statements.
a. Generate Fibonacci series.
AIM:
To perform arithmetic operation using a simple calculator function in visual basic.
ALGORITHM:
STEP1: Start the program
STEP2: Design the application with necessary label box, text box and command box.
STEP3: To change the command button names give 1,2,3---0 and +,-,*,=
STEP4: Write the necessary coding to each other buttons.
STEP5: Get the first value and receive the which operation to perform.
STEP6: Get the second value and and press the assignment symbol
STEP7: Run the application and display the result.
STEP8: Stop the program
PROGRAM:
Dim x as Integer
Dim y as String
Private sub command1_click()
Text1.text=Text1.text+ ”1”
End sub
OUTPUT:
RESULT:
AIM:
To Generate Fibonacci series using for loop
PROCEDURE:
1. Open Visual Basic 6.0 IDE, Select Standard Exe from the New Project Dialog Box and
click open.
2. Create textboxes to get the Fibonacci series.
3. Create command button Fibonacci series.
4. Double click on the buttons and write code to print the Fibonacci series
5. Display the output in the form.
6. Save and Press F5 to execute the application.
CODING:-
Private Sub Command1_Click ( )
For i = 3 To n
sum = x + y
Print sum
x=y
y = sum
y = sum
Next i
End Sub
OUT PUT DESIGN
AIM:
To find the sum of N numbers Using loop
PROCEDURE:
1. Open Visual Basic 6.0 IDE, Select Standard Exe from the
New Project Dialog Box and click open.
2. Create textboxes to get the sum of N numbers
3. Create command button sum of N numbers
4. Double click on the buttons and write code to print the sum of
N numbers
5. Display the output in the form.
6. Save and Press F5 to execute the application.
CODING:-
Private Sub Command1_Click()
Dim n, i, s As Integer
Cls
n = Val(Text1.Text)
For i = 1 To n
s=s+i
Next i
Print "Sum of N Number = "; s
End Sub
2 (C):TRIANGLE FORMAT
AIM:
To display the numbers/symbols in triangle format
PROCEDURE:
1. Open Visual Basic 6.0 IDE, Select Standard Exe from the New Project Dialog Box and click
open.
2. Create display the numbers/symbols in triangle format
3. Create command button display the numbers/symbols in triangle format
4. Double click on the buttons and write code to print the display the numbers/symbols
in triangle format
5. Display the output in the form.
6. Save and Press F5 to execute the application
CODING:-
Private Sub Command1_Click()
Dim i, n As Integer
n = Val(InputBox("Enter Number of rows"))
For i = 1 To n
Print Space(n - i) + String(i, ("*"))
Next i
End Sub
OUTPUT DESIGN:
RESULT:
Thus the above program has been executed successfully.
3 WRITE A PROGRAM TO CREATE A MENU AND MDI FORMS
AIM:
To create a menu and MDI Forms
PROCEDURE:
1. Open Visual Basic 6.0 IDE, Select Standard Exe from the New Project Dialog Box and
click open.
2. Right click the project explorer click add and choose MDI form
3. Right click form and click menu editor
4. give the names for menus and write the code
5. Display the output in the form.
6. Save and Press F5 to execute the application
MDI FORM CODING:
Private Sub EXIT_Click()
End
End Sub
Private Sub OPEN_Click()
Form1.Show
End Sub
FORM CODING:
Private Sub C_Click()
MDIForm1.Show
End Sub
OUTPUT DESIGN:
RESULT:
Thus the above program has been executed successfully.
4. WRITE A PROGRAM TO CREATE A SIMPLE INPUT SCREEN WITH
FOUR BASIC CONTROLS TO READ INPUT AND WRITE IT TO A FILE.
AIM:
To create a simple input screen with four basic controls to read input and write it to a file
PROCEDURE:
1. Open Visual Basic 6.0 IDE, Select Standard Exe from the New Project Dialog Box and
click open.
2. Create Option boxes to display the gender
3. Create command button display the gender in textbox
4. Double click on the buttons and write code to print the display the gender
5. Display the output in the form.
6. Save and Press F5 to execute the application
CODING:
RESULT:
Thus the above program has been executed successfully.
5. WRITE A PROGRAM TO DISPLAY FILES IN A DIRECTORY USING
DRIVELISTBOX, DIRLISTBOX AND FILELISTBOX CONTROL
AIM:
PROCEDURE:
1. Open Visual Basic 6.0 IDE, Select Standard Exe from the New Project Dialog Box and
click open.
2. Create and write code to Dir, drive,file list boxes to display the file and rich text box
3. Create command button to save the file
4. Double click on the buttons and write code to print the saved file
5. Display the output in the form.
6. Save and Press F5 to execute the application
CODING:-
RESULT:
Thus the above program executed success fully.
6. WRITE A PROGRAM TO ILLUSTRATE COMMON DIALOG
CONTROL AND TO OPEN, EDIT AND SAVE TEXT FILE
AIM:
To illustrate Common Dialog Control and to open, edit and save text file.
PROCEDURE:
1. Open Visual Basic 6.0 IDE, Select Standard Exe from the New Project Dialog Box and
click open.
2. Create and TEXT box
3. Create command button to save, open,edit the file
4. Double click on the buttons and write code to print the saved file
5. Display the output in the form.
6. Save and Press F5 to execute the application
CODING:-
Private Sub
cd1.ShowOpen
End Sub
RESULT:
AIM:
To develop windows based installation file with Student Registration form and
Login form using database access.
PROCEDURE:
1. Open Visual Basic 6.0 IDE, Select Standard Exe from the New Project Dialog Box and
click open.
2. Open 2 forms and create form design for login and registration
3. Create command buttons for both forms and place the data control
4. Create the database for registration form
4. Double click on the buttons and write code to print the saved file and change data
properties on property form
5. Display the output in the form.
6. Save and Press F5 to execute the application
LOGIN FORM:
OUTPUT:
RESULT:
Thus the above program has been executed successfully.
8. DEVELOP A PROGRAM TO INSERT, UPDATE, DELETE A RECORD
IN DATABASE USING ADO
AIM:
To develop a program to insert, update, delete a Record in database using ADO
PROCEDURE:
1. Open Visual Basic 6.0 IDE, Select Standard Exe from the New Project Dialog Box and
click open.
2. Open forms and create form design for Student details
3. Create command buttons for forms and place the ADO data control
4. Create the database for registration form
4. Double click on the buttons and write code to Insert, Update, Delete file and change
data properties on property form
5. Display the output in the form.
6. Save and Press F5 to execute the application
CODING:-
RESULT:
Thus the above program has been executed successfully.
9 WRITE A PROGRAM TO IMPLEMENT PERSONAL INFORMATION
SYSTEM USING MDI AND STANDARD ADODC CONTROLS AND
REPORTS.
AIM:
To develop write a program to implement Personal Information System using MDI and
Standard ADODC controls and reports
PROCEDURE:
1. Open Visual Basic 6.0 IDE, Select Standard Exe from the New Project Dialog Box and
click open.
2. Open form and create form design for Personal Information Systems details
3. Create command buttons for forms and place the ADODC data control and MDI form
4. Create the database for Personal Information System
5. Create a new MS access database
6.Click Add button in wizard, Select Microsoft Ms Access driver, Click finish
7. Give Data Source Name and select the database which is already saved and click ok.
8. Double click on the buttons and write the cod change data properties on property
form 9.. Display the output in the form.
10. Save and Press F5 to execute the application
CODING:-
Private Sub PIS_Click()
Form1.Show
Me. Hide
End Sub
RESULT:
Thus the above program has been executed successfully.
10. WRITE A PROGRAM TO IMPLEMENT ANIMATION USING TIMERS.
AIM:
To implement animation using timers
PROCEDURE:
1. Open Visual Basic 6.0 IDE, Select Standard Exe from the New Project Dialog Box and
click open.
2. Place the timer and give the intrevel 1
3. Create command button to move the image and stop the image
4. Double click on the buttons and write code to print the saved file
5. Display the output in the form.
6. Save and Press F5 to execute the application
CODING:-
RESULT:
Thus the above program has been executed successfully.