Ask Me Help Desk

Ask Me Help Desk (https://www.askmehelpdesk.com/forum.php)
-   Visual Basic (https://www.askmehelpdesk.com/forumdisplay.php?f=469)
-   -   I cannot figure out where my error is here is my entire code. I am using Visual Basic (https://www.askmehelpdesk.com/showthread.php?t=562323)

  • Mar 14, 2011, 09:55 PM
    britt0630
    I cannot figure out where my error is here is my entire code. I am using Visual Basic
    I cannot figure out where my error is here is my entire code. I am using Visual Basic and using the program Microsoft visual. I am not sure what I did I'm sure it's one error causing them all maybe a few because they all seem to be the same error. This is due tom and is a final and I had it working until the program crashed and I had to start over again. Any assistance is helpful
    Thanks
    Public Class IT450Final
    Public Science, Mathematics, Writing, Reading As Integer

    Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
    Dim Sum As Integer
    'If user did not enter score
    If TextBoxa.Text = "" Then
    MsgBox("You Forgot to enter a score in Science")
    Return
    End If
    If TextBoxb.Text = "" Then
    MsgBox("You forgot to enter a score in Mathematics")
    Return
    End If
    If TextBoxc.Text = "" Then
    MsgBox(" Your forgot to enter a score in Writing")
    Return
    End If
    If TextBoxd.Text = "" Then
    MsgBox(" You forgot to enter a score in Reading")
    Return
    End If
    'converting to integer
    TextBoxa = CInt(TextBoxa.Text)
    'converting to inteteger
    TextBoxb = CInt(TextBoxb.Text)
    'converting to integer
    TextBoxc = CInt(TextBoxc.Text)
    'converting to integer
    TextBoxd = CInt(TextBoxd.Text)
    If TextBoxa < 0 Or TextBoxa > 5 Then
    MsgBox("Please enter score between 0-50 in Mathematics score Box Please")
    Return
    End If
    If TextBoxb < 0 Or TextBoxb > 5 Then

    End If
    MsgBox("Please enter score between 0-50 in Science score Box Please")
    Return
    If TextBoxc < 0 Or TextBoxc > 5 Then

    End If
    Return
    MsgBox("Please enter score between 0-50 in Writing score Box Please")
    Return
    End
    If TextBoxd < 0 Or TextBoxd > 5 Then
    MsgBox("Please enter score between 0-50 in Reading score Box Please")
    End If
    'Calculate Exam Total
    Sum = TextBoxa + TextBoxb + TextBoxc + TextBoxd

    'Determine letter grade
    If Sum >= 90 Then
    lblgrade.Text = "5"
    ElseIf Sum >= 80 Then
    lblgrade.Text = "4"
    ElseIf Sum >= 70 Then
    lblgrade.Text = "3"
    ElseIf Sum >= 60 Then
    lblgrade.Text = "2"
    Else
    lblgrade.Text = "1"
    End If


    End Sub
    Private Sub Buttonclear_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Buttonclear.Click
    TextBoxa.Text = ""
    TextBoxa.Text = 0
    TextBoxb.Text = 0
    TextBoxc.Text = 0
    TextBoxd.Text = 0
    TextBoxa.Focus()



    End Sub
    End Class


    Errors that I am receiving are
    Error 13 Operator '+' is not defined for types 'System.Windows.Forms.TextBox' and
    'System.Windows.Forms.TextBox'. Line 51 column 15

    Error 5 Operator '<' is not defined for types 'System.Windows.Forms.TextBox' and 'Integer'. line 31 column12

    Error 7 Operator '<' is not defined for types 'System.Windows.Forms.TextBox' and 'Integer'. line 35 column 12

    Error 9 Operator '<' is not defined for types 'System.Windows.Forms.TextBox' and 'Integer'. Line 40 column 12

    Error 11 Operator '<' is not defined for types 'System.Windows.Forms.TextBox' and 'Integer'. line 47 column 12

    Error 6 Operator '>' is not defined for types 'System.Windows.Forms.TextBox' and 'Integer'. line 31 column 28

    Error 8 Operator '>' is not defined for types 'System.Windows.Forms.TextBox' and 'Integer'. line 35 column 28

    Error 10 Operator '>' is not defined for types 'System.Windows.Forms.TextBox' and 'Integer'. line 40 column 28

    Error 12 Operator '>' is not defined for types 'System.Windows.Forms.TextBox' and 'Integer'. line 47 column 28

    Error 1 Value of type 'Integer' cannot be converted to 'System.Windows.Forms.TextBox'. line 24 column 20

    Error 2 Value of type 'Integer' cannot be converted to 'System.Windows.Forms.TextBox'. line 26 column 20

    Error 3 Value of type 'Integer' cannot be converted to 'System.Windows.Forms.TextBox'. line 28 column 20

    Error 4 Value of type 'Integer' cannot be converted to 'System.Windows.Forms.TextBox'. line 30 column 20

  • All times are GMT -7. The time now is 01:31 AM.