Visual Basics Receipt Help?

Can you help me with the code for this question?
I have to make a receipt. This is the code for both forms
FORM 1:
‘Form1’
Option Explicit
‘Declare Variables’
Public SENIOR As Single
Public GENERAL As Single
Public CHILD As Single
Private Sub Form_Load()
GENERAL = 0
SENIOR = 0
CHILD = 0
End Sub
Private Sub Command1_Click()
‘Initialize Variables’
Dim strGeneral As String
Dim strSenior As String
Dim strChild As String
‘Processing’
GENERAL = GENERAL + 1
strGeneral = “General x ” & GENERAL
‘Output’
Label1.Caption = strGeneral
End Sub
Private Sub Command2_Click()
‘Initialize Variables’
Dim strGeneral As String
Dim strSenior As String
Dim strChild As String
‘Processing’
SENIOR = SENIOR + 1
strSenior = “Senior x ” & SENIOR
‘Output’
Label2.Caption = strSenior
End Sub
Private Sub Command3_Click()
‘Initialize Variables’
Dim strGeneral As String
Dim strSenior As String
Dim strChild As String
‘Processing’
CHILD = CHILD + 1
strChild = “Child x ” & CHILD
‘Output’
Label3.Caption = strChild
End Sub
Private Sub Command4_Click()
‘Hide form1’
Form1.Hide
Form2.Show
End Sub
FORM2:
Option Explicit
Private Sub Command1_Click()
Form1.Show
Form2.Hide
End Sub
‘Form 2’
Private Sub Form_Load()
‘Output’
Label1.Caption = “General x ” & Form1.GENERAL & ” = $” & (Form1.GENERAL * 20)
Label2.Caption = Label2.Caption & “Senior x ” & Form1.SENIOR & ” = $” & (Form1.SENIOR * 15)
Label3.Caption = Label3.Caption & “Child x ” & Form1.CHILD & ” = $” & (Form1.CHILD * 10)
Label4.Caption = Label4.Caption & “sub total: ” & ” $” & ((Form1.GENERAL * 20) + (Form1.SENIOR * 15) + (Form1.CHILD * 10))
Label5.Caption = Label5.Caption & “HST: ” & ” $” & ((Form1.GENERAL * 20) + (Form1.SENIOR * 15) + (Form1.CHILD * 10)) * 0.13
Label6.Caption = Label6.Caption & “Total: ” & ” $” & ((Form1.GENERAL * 20) + (Form1.SENIOR * 15) + (Form1.CHILD * 10)) + ((Form1.GENERAL * 20) + (Form1.SENIOR * 15) + (Form1.CHILD * 10)) * 0.13
End Sub
How do I add a discount option where if the sub total is greater than 50 then 5% off, 100 then 10% and 150 then 15%
And then subtracting it from the sub total? And then displaying the final total with the discount.
Thanks!

Both comments and pings are currently closed.

Comments are closed.

Powered by WordPress | Designed by: free css template | Thanks to hostgator coupon and web hosting reviews