This book is an example of programming code for making a shop order form in Microsoft Visual Basic (VB). If you need the compiled program, please PM me. Thank you.
Separation of Lanthanides/ Lanthanides and Actinides
Burger doll order form
1. Burger Doll Order Form
An example of a program code for Burger Doll Order Form system is shown as follows:
1. Declare Types of Meals and Rates array in General section:
Dim typemeal(4) As String
Dim rates(1 To 6) As Double
Dim ExtraHrs, TtlAmt, j As Integer
2. Assign all values of Types of Meals and Rates in Form_Load:
Private Sub Form_Load()
typemeal(1)
typemeal(2)
typemeal(3)
typemeal(4)
rates(1)
rates(2)
rates(3)
rates(4)
rates(5)
rates(6)
=
=
=
=
=
=
=
=
=
=
"D.L. Beef Burger"
"Chicken Slice Burger"
"Fish Burger"
"Smoke Beef Sandwich "
10.5
5.5
13#
14#
6 / 100
10 / 100
End Sub
1
2. 3. To display all information from Types of Melas and Rates button in the Object
BoxList and prompt the message box for listing loaded, the Display as shown in
Figure1.1:
Private Sub CmdDsplayTypeMeal_Click()
t = Chr(9) 'tab values
For i = 1 To 4
list1.AddItem (typemeal(i) & t & "RM " & rates(i))
Next
list1.Clear
list1.AddItem "D.L. Beef Burger"
list1.ItemData(list1.NewIndex) = 1
list1.AddItem "Chicken Slice Burger"
list1.ItemData(list1.NewIndex) = 2
list1.AddItem "Fish Burger"
list1.ItemData(list1.NewIndex) = 3
list1.AddItem "Smoke Beef Sandwich"
list1.ItemData(list1.NewIndex) = 4
MsgBox" Order Please...", _
vbInformation, "Burger Doll Order Form"
End Sub
4. Next, to select Type of Car for result using List Box ( LblMeal)
5. Type in the next box for total day(s) using text box (txtQua) and type the extra
hour(LblCheese)
Private Sub LblCheese_Change()
LblHr3 = Val(LblCheese) * 1
End Sub
2
3. 6. Finally, The program code btnCalculate_Click function for bill amount include
aRM30 deposit is as follows, as shown in Figure 1.3:
Private Sub btnCalculate_Click()
If list1.ItemData(list1.ListIndex) = 1 Then
TxtAmt.Text = (rates(1) * txtQua) + Val(LblHr3)
GovTax.Text = Format(Val(TxtAmt.Text) * rates(5), "#.##")
TtlDay.Text = Val(TxtAmt) + Val(GovTax) + Val(sertax)
End If
If list1.ItemData(list1.ListIndex) = 2 Then
TxtAmt.Text = (rates(2) * txtQua) + Val(LblHr3)
GovTax.Text = Format(Val(TxtAmt) * rates(5), "#.##")
TtlDay.Text = Val(TxtAmt) + Val(GovTax) + Val(sertax)
End If
If list1.ItemData(list1.ListIndex) = 3 Then
TxtAmt.Text = (rates(3) * txtQua) + Val(LblHr3)
GovTax.Text = Format(Val(TxtAmt) * rates(5), "#.##")
TtlDay.Text = Val(TxtAmt) + Val(GovTax) + Val(sertax)
End If
If list1.ItemData(list1.ListIndex) = 4 Then
TxtAmt.Text = (rates(4) * txtQua) + Val(LblHr3)
GovTax.Text = Format(Val(TxtAmt) * rates(5), "#.##")
TtlDay.Text = Val(TxtAmt) + Val(GovTax) + Val(sertax)
End If
End Sub
7. To reset the value using reset button (cmdReset):
Private Sub cmdReset_Click()
LblCheese.Text = 0#
TxtAmt.Text = 0#
GovTax.Text = 0#
txtQua.Text = 1
TtlDay.Text = 0#
sertax.Text = 0#
txtName.Text = ""
chkDine.Value = 0
End Sub
3
4. 8. To prompt printing for bill payment with using Print button, as shown Figure 1.4:
Private Sub btnOrder_Click()
t = Chr(9) 'tab
Do
j=j+1
list2.AddItem (j & "." &txtName& t & list1 & t & t &txtQua& t &TxtAmt& t &_
GovTax& t & t &sertax& t & t & LblHr3 & t &TtlDay)
Loop Until TtlAmt<= 0
End Sub
9. Clear button to clear list box for bill payment (btnClear):
Private Sub btnClear_Click()
list2.Clear
j=0
End Sub
10. Exit button (btnExit):
Private Sub btnExit_Click()
End
End Sub
11. About Menu Button (mnuabout)
Private Sub mnuabout_Click()
frmAbout.Show
End Sub
4
5. 12. About Menu Button (mnuMeal)
Private Sub mnumeal_Click()
frmMeal.Show
End Sub
13. Set the output format for the (GovTax), (Text1), (TtlDay), (TxtAmt):
Private Sub [name]_Change()
output = Format("#.##")
End Sub
14. Check box for Dine in (chkdine)
Private Sub chkDine_Click()
If chkDine.Value = 1 Then
sertax.Text = Format(Val(TxtAmt) * rates(6), "#,##")
Else
sertax.Text = 0
End If
End Sub
5
6. Below the program interface for Car Rental Booking system:
Figure 1.0: Main Frame for Burger Doll Order System
6