Vbprogram - Programs Vbprogram - Programs
Vbprogram - Programs Vbprogram - Programs
VBProgram - programs
Part A
1. Write a VB program to design a simple calculator to perform addition, subtraction,
multiplication and division (Use functions for the calculations).
2. Design a User Interface (UI) to accept the student details such as name, department, and
total marks. Validate the input data and calculate the percentage and division.
3. Design a VB application which has MDI and child forms. Create a Menu having the items
such as File(New,Open), Format(Font, regular, Bold, Italic ) and Exit in the MDI form. Also
create a text box and use a Common Dialog Box control for changing the font, forecolor and
back color of the text box.
4. VB Program to Encrypt and Decrypt a string. (Use Rnd() to generate the Encryption and
Decryption keys).
5. Create a vending machine application, that display images for four snacks, and
corresponding labels that indicate number for each snack. The GUI should contain a text
box in which the user specifies the number of the desired snack. When the dispense snack
button is clicked, it should display on a label the name of the snack dispensed. At end it
should print (display) the bill of the product.
6. Design a small Alarm Clock Application.
7. Write a VB program to validate the username and password from the database and
display the appropriate message. (use Data Control)
8. Write an application for Airline Reservation System, which allows the user to book ticket
on a particular date for a particular type of class. At the end, once the ticket is booked, it
should display a boarding pass indicating the person’s seat no., type of class and total fare.
Input validations should be done properly. You can use arrays or databases for storing the
information.
Part B
9. Design a VB application to accept the Item Details (ItemId, ItemName, MfdDate,
UnitOfMeasure, and RatePerUnit). ItemId should be a system generated id. The application
should allow the operations - Add, Modify, Delete, Update and Navigations of the items.
Use ADO Data controls and Grid Controls.
10. Design a VB application to record the Employee Details such as EmpId, EmpName,
Designation, and BasicPay. Calculate the DA, HRA, Deductions and Gross Salary. (Make
the necessary assumptions). Use Select=Case for decision making.
11. Design a mini ATM Application, which validates the user on the basis of its account no.,
and password. After validation customer is allowed to do many operations such as
withdrawal, mini statement, checking balance etc. Application should perform the concerned
operation and the account of the user should be updated accordingly.
12. VB program to calculate the Simple Interest and Compound Interest. Use DLLs for the
calculations.
Dim x As Double
Dim y As Double
Dim z As Double
Dim optr As String
Dim fun As Integer
2. Design a User Interface (UI) to accept the student details such as name, department, and
total marks. Validate the input data and calculate the percentage and division.
total = Val(txttmarks.Text)
txtdname.Text = ""
txttmarks.Text = ""
Me.Width = 3900
Me.Height = 2790
Me.Caption = "Student Details"
txttmarks.MaxLength = 3
End Sub
3. Design a VB application which has MDI and child forms. Create a Menu having the items
such as File(New,Open), Format(Font, regular, Bold, Italic ) and Exit in the MDI form. Also
create a text box and use a Common Dialog Box control for changing the font, forecolor and
back color of the text box.
decryptval = mynewstring
lbldecrp.Caption = decryptval
cmdencrp.Enabled = False
cmddecrp.Enabled = False
End Sub
Private Sub cmdencrp_Click()
Dim mynewstring As String
mystring = text1.Text
mychar = ""
strlen = Len(mystring)
For i = 1 To strlen
mychar = Mid(mystring, i, 1)
Select Case Asc(mychar)
Case 65 To 90
mychar = Chr(Asc(mychar) + 127)
Case 97 To 122
mychar = Chr(Asc(mychar) + 121)
Case 48 To 57
mychar = Chr(Asc(mychar) + 196)
Case 32
mychar = Chr(32)
End Select
mynewstring = mynewstring + mychar
Next i
encryptval = mynewstring
lblencrp.Caption = encryptval
cmdencrp.Enabled = False
cmddecrp.Enabled = True
End Sub
5. Create a vending machine application, that display images for four snacks, and
corresponding labels that indicate number for each snack. The GUI should contain a text
box in which the user specifies the number of the desired snack. When the dispense snack
button is clicked, it should display on a label the name of the snack dispensed. At end it
should print (display) the bill of the product.
Form2.lblqty1.Caption = g
Form2.lblprice1.Caption = "55"
Form2.lbltotal1.Caption = 55 * g
End If
End If
End Sub
Private Sub cmdprintbill_Click()
Unload Me
Form2.Show
End Sub
Private Sub Form_Load()
txtdsnack1.Text = ""
txtdsnack2.Text = ""
txtdsnack3.Text = ""
txtdsnack4.Text = ""
cmdprintbill.Enabled = False
End Sub
7. Write a VB program to validate the username and password from the database and
display the appropriate message. (use Data Control)
Adodc1.Refresh
Adodc1.Recordset.MoveFirst
While Not Adodc1.Recordset.EOF
If txtusername.Text = Adodc1.Recordset.Fields(0) And txtpassword.Text = Adodc1.Recordset.Fields(1)
Then
MsgBox "you have logged in Sucessfully", vbOKOnly, "Login"
txtusername.Text = ""
txtpassword.Text = ""
Exit Sub
Else
Adodc1.Recordset.MoveNext
End If
Wend
MsgBox "Login Failed", vbOKOnly, "Login"
txtusername.Text = ""
txtpassword.Text = ""
End Sub
8. Write an application for Airline Reservation System, which allows the user to book ticket
on a particular date for a particular type of class. At the end, once the ticket is booked, it
should display a boarding pass indicating the person’s seat no., type of class and total fare.
Input validations should be done properly. You can use arrays or databases for storing the
information.
10. Design a VB application to record the Employee Details such as EmpId, EmpName,
Designation, and BasicPay. Calculate the DA, HRA, Deductions and Gross Salary. (Make
the necessary assumptions). Use Select=Case for decision making.
11. Design a mini ATM Application, which validates the user on the basis of its account no.,
and password. After validation customer is allowed to do many operations such as
withdrawal, mini statement, checking balance etc. Application should perform the concerned
operation and the account of the user should be updated accordingly.
12. VB program to calculate the Simple Interest and Compound Interest. Use DLLs for the
calculations.