none
Homework Again but.... RRS feed

  • Question

  • This time I feel like I am closer to understanding, I keep getting the error "relational operator expected" and "expression expected" in reference to what is in bold... is something not connecting the dots here?

    Option Strict On
    Public Class Form1
        Dim intPacka, intPackb As TextBox
        Dim lbresult As Label
        Private Sub btnCalc_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnCalc.Click
            'Variable declaration
            Dim intPackav As Integer
            Dim intPackbv As Integer
            Dim intPackcv As Integer
            Dim dblPriceav As Double = 99
            Dim dblPricebv As Double = 199
            Dim dblPricecv As Double = 299
            Dim dblPackafullv As Double
            Dim dblPackbfullv As Double
            Dim dblPackcfullv As Double
            'Value identity
            intPackav = CInt(intPacka.Text)
            intPackbv = CInt(intPackb.Text)
            intPackcv = CInt(intPackb.Text)
            lbresult.Text = " "
            'Calculations
            If IsNumeric(intPackav) And intPackav > 0 Then
                Select (intPackav)
                    Case 10 To 19
                        dblPackafullv = (dblPriceav - (dblPriceav * 0.2)) * intPackav
                    Case 20 To 49
                        dblPackafullv = (dblPriceav - (dblPriceav * 0.3)) * intPackav
                    Case 50 To 99
                        dblPackafullv = (dblPriceav - (dblPriceav * 0.4)) * intPackav
                    Case Is > 100
                        dblPackafullv = (dblPriceav - (dblPriceav * 0.5)) * intPackav
                End Select
                If IsNumeric(intPackbv) And intPackbv > 0 Then
                    Select Case (intPackbv)
                        Case 10 To 19
                            dblPackbfullv = (dblPricebv - (dblPricebv * 0.2)) * intPackbv
                        Case 20 To 49
                            dblPackbfullv = (dblPricebv - (dblPricebv * 0.3)) * intPackbv
                        Case 50 To 99
                            dblPackbfullv = (dblPricebv - (dblPricebv * 0.4)) * intPackbv
                        Case Is > 100
                            dblPackbfullv = (dblPricebv - (dblPricebv * 0.5)) * intPackbv
                    End Select
                    If IsNumeric(intPackcv) And intPackcv > 0 Then
                        Select Case (intPackcv)
                            Case 10 To 19
                                dblPackcfullv = (dblPricecv - (dblPricecv * 0.2)) * intPackcv
                            Case 20 To 49
                                dblPackcfullv = (dblPricecv - (dblPricecv * 0.3)) * intPackcv
                            Case 50 To 99
                                dblPackcfullv = (dblPricecv - (dblPricecv * 0.4)) * intPackcv
                            Case Is > 100
                                dblPackcfullv = (dblPricecv - (dblPricecv * 0.5)) * intPackcv
                        End Select
                        lbresult.Text =
                "Package A : " & FormatCurrency(dblPackafullv) & vbCrLf &
                "Package B : " & FormatCurrency(dblPackbfullv) & vbCrLf & "Package C : " &
                       FormatCurrency(dblPackcfullv) & vbCrLf &
                "Total : " &
                FormatCurrency(dblPackafullv + dblPackbfullv + dblPackcfullv)
                    End If
                End If
            End If
        End Sub
    End Class
    

    • Edited by Paul IshakModerator Tuesday, February 19, 2013 9:28 PM Unreadable... Insert code using block...
    Tuesday, February 19, 2013 5:07 AM

Answers

All replies