|
-
October 8th, 2011, 09:08 AM
#1
Visual Basic Beginner Programming with If then Else statements?
I am trying to create a program that calculates the prices of different payment methods of a buffet. I have started it but has run into some unknown problem and hoping someone could guide me.
The program requirements are simple. The buffet start in 1/7/2011 and ends 31/8/2011. Payments methods are online, cash and coupon. coupon is only valid from 1/8/2011 to 31/8/ 2011. 1 child is free for every 2 adult that pay. There are different prices for weekends (sat and sun) and different prices for weekdays.
So my program is like this so far: Please assume all variables are declared
If scheduleDate < #7/1/2011# Or scheduleDate > #8/31/2011# Then
MessageBox.Show("Beyond promotion period")
Exit Sub
ElseIf adult <= 0 And senior <= 0 And childlow <= 0 And childhigh <= 0 Then
MessageBox.Show("Please enter at least one person")
Exit Sub
to deduce the number of child paying, I came up with this:
ElseIf CInt(txtAdult.Text) \ 2 < CInt(txtChildLow.Text) Then 'adult number < child number
payingChild = CInt(txtChildLow.Text) - _
CInt(txtAdult.Text) \ 2
Else
payingChild = 0
And then I don't know how to carry on. Please help......!!!!!!!!
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|