I am using this code to produce an APP that is supposed to calc the travel cost of a family with 2 adults and 2 children.
The adult charge is 70 and the child price is 30 if the child is under 13, under the age of 2 travel free.
What I am looking to do is find a better way to show the adult price and achieve a total cost.
Private Sub cmdQUIT_Click()
'Terminate Application
End
End Sub
Private Sub cmdStart_Click()
'Declare required storage
Dim Child_Age As Integer
Dim Child_Age2 As Integer
Dim Adult_Pri As Integer
'Ask user what age their children are
Child_Age = InputBox("How old is your first child ", "What Age")
Child_Age2 = InputBox("How old is your second child ", "What Age")
Select Case Child_Age
Case Is <= 2
picMessage.Print "The First Child price is Free"
Case Is < 13
picMessage.Print "The First Child price is 30 Pounds"
Case Is >= 13
picMessage.Print "The First Child price is 70 Pounds"
End Select
Select Case Child_Age2
Case Is <= 2
picMessage.Print "The Second Child price is Free"
Case Is < 13
picMessage.Print "The Second Child price is 30 Pounds"
Case Is >= 13
picMessage.Print "The Second Child price is 70 Pounds"
End Select
Adult_Pri = 70
'Display message in picture box
picMessage.Print "The price per adult is " & Adult_Pri; " "; "Pounds"
End Sub
Can anyone gimme a piece of advice please.
Thanks
Charlie
The adult charge is 70 and the child price is 30 if the child is under 13, under the age of 2 travel free.
What I am looking to do is find a better way to show the adult price and achieve a total cost.
Private Sub cmdQUIT_Click()
'Terminate Application
End
End Sub
Private Sub cmdStart_Click()
'Declare required storage
Dim Child_Age As Integer
Dim Child_Age2 As Integer
Dim Adult_Pri As Integer
'Ask user what age their children are
Child_Age = InputBox("How old is your first child ", "What Age")
Child_Age2 = InputBox("How old is your second child ", "What Age")
Select Case Child_Age
Case Is <= 2
picMessage.Print "The First Child price is Free"
Case Is < 13
picMessage.Print "The First Child price is 30 Pounds"
Case Is >= 13
picMessage.Print "The First Child price is 70 Pounds"
End Select
Select Case Child_Age2
Case Is <= 2
picMessage.Print "The Second Child price is Free"
Case Is < 13
picMessage.Print "The Second Child price is 30 Pounds"
Case Is >= 13
picMessage.Print "The Second Child price is 70 Pounds"
End Select
Adult_Pri = 70
'Display message in picture box
picMessage.Print "The price per adult is " & Adult_Pri; " "; "Pounds"
End Sub
Can anyone gimme a piece of advice please.
Thanks
Charlie