I'm new in VB programming I did wrote this code so far but for some reason the senior does not calculate. Any help will greatly appreciate. This is what I'm trying to accomplished.
"basic monthly cost of a membership is \$100 for adults and \$75 for seniors. Members must choose a level of membership { Gold, which adds \$300 to the cost of the membership; Silver, which adds \$250 to the cost; or Bronze, which adds \$150."

``````Public Class frmMembership

Private Sub btnCalculate_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnCalculate.Click
' Names

' btnCalculate
' txtMthFee

' Variables
Dim fee As Double
Dim senior As Double

' input from the membership
'senior = CDbl(radSenior.Text) ' Monthly Cost
fee = CDbl(fee)

' Calculate
' fee = (txtMthFee.Text)

' Function
senior = 75
End If

fee = senior + 300
fee = senior + 250
fee = senior + 150
End If

' Display output
txtMthFee.Text = CStr(fee)

End Sub
End Class``````

I think u had done it wrong in here

``````' add Monthly Membership
fee = senior + 300
fee = senior + 250
fee = senior + 150
End If``````

Because,

adult and senior needs to choose membership. Gold, which adds \$300 to the cost of the membership; Silver, which adds \$250 to the cost; or Bronze, which adds \$150."

I think u had done it wrong in here

``````' add Monthly Membership
fee = senior + 300
fee = senior + 250
fee = senior + 150
End If``````

Ya.. I know.. but your last three conditions shouldn't it be

``````ElseIf radGold.Checked Then
fee = senior + 300
fee = senior + 250
fee = senior + 150``````

``````If radAdult.Checked Then

senior = 75
End If``````

That is just my suggestion on how I will do it.

Ya.. I know.. but your last three conditions shouldn't it be

``````ElseIf radGold.Checked Then
fee = senior + 300
fee = senior + 250
fee = senior + 150``````

``````If radAdult.Checked Then

senior = 75
End If``````

That is just my suggestion on how I will do it.

Hi BlurrieBlue,
I did some change on to my code and I now the adult membership is not calculating.
Thanks

``````' Variables
Dim fee As Double
Dim senior As Double

senior = 75
End If

End If

' Senior

fee = senior + 300
fee = senior + 250
fee = senior + 150
End If

' Display output
txtMthFee.Text = CStr(fee)``````

Hi, you may try it like this.

``````If radAdult.Checked = True Then
End If
End If
End If
End If

senior = 75
fee = senior + 300
End If
fee = senior + 250
End If
fee = senior + 150
End If
End If

txtMthFee.Text = CStr(fee)``````

First of all the basic cost doesn't change, so it doesn't have to be in an if statement.
What needs to go in that if statement is if you are adding the adult or the senior cost to the membership.

I'm assuming that this is an exercise for IFs, so I'm not using select case.

``````' Variables
Dim fee As Double
Dim basic_fee as Double
Dim membership_cost As Double

basic_fee = 100
basic_fee = 75
Else txtMthFee.Text = "Please select your subscription category" 'Change this to whatever you want, but unless you've set one of the 2 as selected by default you need it. If you've set a default then you don't need 2 IFs, but only 1 as there is only 1 alternative
exit sub 'So that the txtMthFee won't display the wrong number
End If

' Monthly Membership

membership_cost = 300
membership_cost = 250
membership_cost = 150
Else txtMthFee.Text = "Please select your membership level" 'Change this to whatever you want, but unless you've set a default you need it.
exit sub 'So that the txtMthFee won't display the wrong number
End If

fee = basic_fee + membership_cost

' Display output
txtMthFee.Text = CStr(fee)``````

First of all the basic cost doesn't change, so it doesn't have to be in an if statement.
What needs to go in that if statement is if you are adding the adult or the senior cost to the membership.

I'm assuming that this is an exercise for IFs, so I'm not using select case.

``````' Variables
Dim fee As Double
Dim basic_fee as Double
Dim membership_cost As Double

basic_fee = 100
basic_fee = 75
Else txtMthFee.Text = "Please select your subscription category" 'Change this to whatever you want, but unless you've set one of the 2 as selected by default you need it. If you've set a default then you don't need 2 IFs, but only 1 as there is only 1 alternative
exit sub 'So that the txtMthFee won't display the wrong number
End If

' Monthly Membership

membership_cost = 300
membership_cost = 250
membership_cost = 150
Else txtMthFee.Text = "Please select your membership level" 'Change this to whatever you want, but unless you've set a default you need it.
exit sub 'So that the txtMthFee won't display the wrong number
End If

fee = basic_fee + membership_cost

' Display output
txtMthFee.Text = CStr(fee)``````

Thank you very much for you input in my code its working the way I wanted.
I really appreciated you help
Toldav.