I am having trouble figuring out where my issue with this code is. My calculations work perfectly until the last case (CASE IS > 8), which continuously returns a 0.00 as the result. I’m sure its something small that a newbie like me is missing due to lack of experience. Thank you for your help!
‘ Declaration of Variable
Convert.ToInt32(txtAttending.Text) Dim decAttending = txtAttending.Text If IsNumeric(txtAttending.Text) And txtAttending.Text <= 16 Then Select Case txtAttending.Text Case Is = 1 decCost = 695 * decAttending Case 2 To 4 decCost = 545 * decAttending Case 5 To 8 decCost = 480 * decAttending Case Is > 8 decCost = 395 * decAttending End Select Else MsgBox("Please double check that your input is a number not greater than 16", , "Input Error") End If If radYes.Checked = True Then decFinalCost = (decCost - (decCost * 0.15)) lblRepeatDiscount.Visible = True decDiscount = (decCost * 0.15) lblDiscount.Text = decDiscount.ToString("C") lblTotalPrice.Text = decFinalCost.ToString("C") Else decFinalCost = decCost lblTotalPrice.Text = decFinalCost.ToString("C") End If
1 Answer