none
code B30456

Answers

  • Val,

    I'm totally guessing because there's not much to go on, but your variable "readonly" being declared as Object may be the problem.

    Still though, there's a lot in there that honestly doesn't make much sense. Is this a school assignment?

    Explain more about what it is and what's supposed to do and I feel sure you'll get some good answers.

    *****

    Next time, please put the code in a Code Block.


    "A problem well stated is a problem half solved.” - Charles F. Kettering

    • Marked as answer by ValH33 Sunday, April 16, 2017 4:22 PM
    Saturday, April 15, 2017 3:49 PM
  • yes it is a school assignment my first and totally don't know what I am doing

    • Marked as answer by ValH33 Sunday, April 16, 2017 4:22 PM
    Saturday, April 15, 2017 5:01 PM
  • yes it is a school assignment my first and totally don't know what I am doing

    Well it's hard to make any sort of suggestion given the constraints, but let's try anyway.

    Tell me what your program is supposed to do and we'll go from there.


    "A problem well stated is a problem half solved.” - Charles F. Kettering


    • Marked as answer by ValH33 Saturday, April 15, 2017 5:34 PM
    • Unmarked as answer by ValH33 Saturday, April 15, 2017 5:34 PM
    • Edited by Frank L. Smith Saturday, April 15, 2017 5:35 PM ...typo
    • Marked as answer by ValH33 Sunday, April 16, 2017 4:21 PM
    Saturday, April 15, 2017 5:04 PM
  • yes it is a school assignment my first and totally don't know what I am doing

    You have far too much code that is untested.   Take one tiny bit of your assignment and do that.  You might have to write some code to test the result, which you can throw away later, but that is worthwhile in the long run.

    For instance, create a form and write some code that allows the user to enter the number of days and shows what it is and displays a messagebox if it is less than 1.  That will need a form with a text box, some labels and a button.   Your text should have an example you can adapt, or there are tutorials on-line.  Get that working before moving on.

    • Marked as answer by ValH33 Sunday, April 16, 2017 4:21 PM
    Saturday, April 15, 2017 10:48 PM
  • The first thing you must do is write on a paper how you would solve the problem if it was not on a computer. 

    Your solution is strange. 

    However, what your problem is, that you did probably not create a windows forms project and did not drag from the toolbox a listbox on the surface. 

    Then there will be something created which you can give a name. Then you can remove that dim ListDisplay ...................... from your code. 

    But problems will raise on other places.


    Success
    Cor


    • Edited by Cor LigthertMVP Sunday, April 16, 2017 7:55 AM
    • Marked as answer by ValH33 Sunday, April 16, 2017 4:19 PM
    Sunday, April 16, 2017 7:54 AM

All replies

  • Can someone help me with this I getting this error message with lst.display
    Error BC30574 Option Strict On disallows late binding

    Public Class form1
        Const SETFEE As Integer = 250
        Private ReadOnly checked As Object
        Private Sub btnCalculate_Click(sender As Object, e As EventHandler) Handles btnCalculate.Click
            'declair variables
            'string = text and phone numbers
            'integer = no decimal, small number
            'decimal = allows decimal
            ' date = any date
            'boolean = true, false
            'Assign Variables
            Dim TravelLocation, DailyCost As Decimal
            Dim NumberOfPeople, NumberOfDays As Integer
            Dim Insurance As Decimal
            Dim SETFEE As Integer
            Dim Africa As Integer
            Dim UnitedStates As Integer
            Dim Haiti As Integer
            Dim Mexico As Integer
            Dim lstDisplay As Object
            Dim GroupName As String = "Liberty University"
            If NumberOfDays = CDec("0") = True Then
            End If
            MessageBox.Show("Please enter a number")
            Return
            Dim TotalCostOfMissionTrip As Decimal
            Dim chkInsurance As Object = Nothing
            'decide if insurance is assigned
            If chkInsurance Is checked = True Then
                Insurance = 300
            Else
                Insurance = 0
            End If
            Select Case TravelLocation
                Case Africa
                    Africa = 500
                Case UnitedStates
                    UnitedStates = 100
                Case Mexico
                    Mexico = 200
                Case Haiti
                    Haiti = 400
            End Select
            ''do calculation
            TotalCostOfMissionTrip = ((NumberOfPeople) * (DailyCost) * (NumberOfDays)) + Insurance + SETFEE
            ''display information
            lstDisplay.Items.Add("Mission Coordinator :" & vbTab & "Miranda", "Deyer")
            lstDisplay.Items.Add("Mission Guide :" & vbTab & "Valerie", "Alfalla")
            lstDisplay.Items.Add("Group Name :" & vbTab & "liberty university.ToUpper".ToUpper)
            lstDisplay.items.Add("Mission Location) :" & vbTab & "Africa", "UnitedStates", "Mexico", "Haiti")
            Dim NumberofTravelers As Decimal = Nothing
            lstDisplay.items.Add("Number of Travelers :" & vbTab & NumberofTravelers * DailyCost)
            lstDisplay.Items.Add("Daily Cost :" & vbTab & CDec(FormatCurrency(DailyCost)))
            lstDisplay.items.Add("Number of Days :" & vbTab & NumberOfDays * DailyCost + Insurance + SETFEE)
            lstDisplay.items.Add("Insurance Fee :" & vbTab & CDec(FormatCurrency(InsuranceFee)))
            lstDisplay.items.Add("Total Cost of Mission Trip :" & vbTab & CDec(FormatCurrency(TotalCostOfMissionTrip = ((NumberOfPeople) * (DailyCost) * (NumberOfDays)) + Insurance + SETFEE)))
        End Sub
        Private Function InsuranceFee() As Object
            Throw New NotImplementedException()
        End Function
    End Class


    Saturday, April 15, 2017 3:34 PM
  • Val,

    I'm totally guessing because there's not much to go on, but your variable "readonly" being declared as Object may be the problem.

    Still though, there's a lot in there that honestly doesn't make much sense. Is this a school assignment?

    Explain more about what it is and what's supposed to do and I feel sure you'll get some good answers.

    *****

    Next time, please put the code in a Code Block.


    "A problem well stated is a problem half solved.” - Charles F. Kettering

    • Marked as answer by ValH33 Sunday, April 16, 2017 4:22 PM
    Saturday, April 15, 2017 3:49 PM
  • yes it is a school assignment my first and totally don't know what I am doing

    • Marked as answer by ValH33 Sunday, April 16, 2017 4:22 PM
    Saturday, April 15, 2017 5:01 PM
  • yes it is a school assignment my first and totally don't know what I am doing

    Well it's hard to make any sort of suggestion given the constraints, but let's try anyway.

    Tell me what your program is supposed to do and we'll go from there.


    "A problem well stated is a problem half solved.” - Charles F. Kettering


    • Marked as answer by ValH33 Saturday, April 15, 2017 5:34 PM
    • Unmarked as answer by ValH33 Saturday, April 15, 2017 5:34 PM
    • Edited by Frank L. Smith Saturday, April 15, 2017 5:35 PM ...typo
    • Marked as answer by ValH33 Sunday, April 16, 2017 4:21 PM
    Saturday, April 15, 2017 5:04 PM
  • yes it is a school assignment my first and totally don't know what I am doing

    You have far too much code that is untested.   Take one tiny bit of your assignment and do that.  You might have to write some code to test the result, which you can throw away later, but that is worthwhile in the long run.

    For instance, create a form and write some code that allows the user to enter the number of days and shows what it is and displays a messagebox if it is less than 1.  That will need a form with a text box, some labels and a button.   Your text should have an example you can adapt, or there are tutorials on-line.  Get that working before moving on.

    • Marked as answer by ValH33 Sunday, April 16, 2017 4:21 PM
    Saturday, April 15, 2017 10:48 PM
  • The first thing you must do is write on a paper how you would solve the problem if it was not on a computer. 

    Your solution is strange. 

    However, what your problem is, that you did probably not create a windows forms project and did not drag from the toolbox a listbox on the surface. 

    Then there will be something created which you can give a name. Then you can remove that dim ListDisplay ...................... from your code. 

    But problems will raise on other places.


    Success
    Cor


    • Edited by Cor LigthertMVP Sunday, April 16, 2017 7:55 AM
    • Marked as answer by ValH33 Sunday, April 16, 2017 4:19 PM
    Sunday, April 16, 2017 7:54 AM