Question
I Got 8 error can someone help me to solve it. Public Class frmtrip Dim inquiryNum As Integer = 500 Private Sub btncalculate_Click(sender As Object,
I Got 8 error can someone help me to solve it.
Public Class frmtrip
Dim inquiryNum As Integer = 500 Private Sub btncalculate_Click(sender As Object, e As EventArgs) Handles btncalculate.Click Dim comma As Integer Dim departure, returnD As Date Dim rates As Decimal Dim tax, excurisons As Decimal Dim name, inquiryID As String Const hiking As Decimal = 20D Const applepicking As Decimal = 25D Const elkwatching As Decimal = 45D Const massage As Decimal = 100D Const ballgame As Decimal = 50D Const concert As Decimal = 25D Const registration As Decimal = 50D Dim subtotal, TotalCost As Decimal GetInput(name, departure, returnD, comma) DisplayRoomCost(name, departure, returnD, rates) HandleExcursion(hiking, applepicking, elkwatching, massage, ballgame, concert) DisplayTotals(SubTotal, tax, TotalCost) End Sub Sub GetInput(ByRef name As String, ByRef departure As Data, ByRef returnD As Data, ByRef comma As Integer) name = txtname.Text departure = mtbdeparture.Text returnD = mtbreturn.Text comma = name.IndexOf(,) End Sub Function InquiryID(inquirynum As Integer, comma As Integer) As Integer comma = Name.IndexOf(",") InquiryID = (Name.Substring(0, 1) & Name.Substring(comma + 1, 1) & inquirynum) inquirynum += 5 Return inquirynum End Function Function LenghtOfTrip(departure As Data, returnD As Date) As Data Dim rates As Decimal Dim numofnight As Integer If lstdestination.SelectedIndex = 0 Then rates = 149D ElseIf lstdestination.SelectedIndex = 1 Then rates = 99D ElseIf lstdestination.SelectedIndex = 2 Then rates = 249D ElseIf lstdestination.SelectedIndex = 3 Then rates = 99D ElseIf lstdestination.SelectedIndex = 4 Then rates = 129D End If numofnight = CInt(DateDiff(DateInterval.Day, departure, returnD)) If radsingle.Checked Then rates = CDec(rates * numofnight * 1.75) Else rates = rates * numofnight End If Return rates End Function Sub HandleExcursions(hiking, applepicking, elkwatching, massage, ballgame, concert) Dim excurisons As Decimal If chkhiking.Checked Then excurisons += hiking End If If chkapplepicking.Checked Then excurisons += applepicking End If If chkelkwatching.Checked Then excurisons += elkwatching End If If chkmassage.Checked Then excurisons += massage End If If chkballgame.Checked Then excurisons += ballgame End If If chkconcert.Checked Then excurisons += concert End If End Sub Function SubTotal(rates As Decimal, registration As Decimal) As Decimal SubTotal = rates + registration Return SubTotal End Function Function Tax(SubTotal As Decimal, excursions As Decimal) As Decimal Tax = (SubTotal + excursions) * 0.1 Return Tax End Function Function TotalCost(SubTotal As Decimal, tax As Decimal) As Decimal TotalCost = SubTotal + tax Return TotalCost End Function Sub DisplayRoomCost(ByVal name As String, ByVal inquiryID As String, ByVal departure As Date, ByVal returnD As Date, ByVal numofnight As Integer, ByVal rates As Decimal) lstoutput.Items.Add("Name: " & name & " " & "Inquiry id: " & inquiryID) lstoutput.Items.Add("") lstoutput.Items.Add("Estimated Cost for the trip of " & lstdestination.SelectedItem) lstoutput.Items.Add("Departing On: " & departure & " and returning on: " & returnD) lstoutput.Items.Add("") lstoutput.Items.Add("Base cost for selected room for " & numofnight & " nights: " & rates) lstoutput.Items.Add("Registration fee $50") If chkhiking.Checked = True Then lstoutput.Items.Add(Hiking- $20) End If If chkapplepicking.Checked = True Then lstoutput.Items.Add(Apple Picking- $25) End If If chkelkwatching.Checked = True Then lstoutput.Items.Add(Elk Watching- $45) End If If chkmassage.Checked = True Then lstoutput.Items.Add(Massage- $100) End If If chkballgame.Checked = True Then lstoutput.Items.Add(Ballgame- $50) End If If chkconcert.Checked = True Then lstoutput.Items.Add(Concert- $25) End If If chkhiking.Checked = False And Not chkapplepicking.Checked And Not _ chkelkwatching.Checked And Not chkmassage.Checked And Not chkballgame.Checked And Not chkconcert.Checked Then lstoutput.Items.Add(NONE) End If End Sub Sub DisplayTotal(ByRef SubTotal As Decimal, ByRef Tax As Decimal, ByRef TotalCost As Decimal) lstoutput.Items.Add("Sub Total (before tax) " & SubTotal) lstoutput.Items.Add("Tax Cost: " & Tax) lstoutput.Items.Add("Total Estimate of trip: " & TotalCost) End Sub Private Sub btnclear_Click(sender As Object, e As EventArgs) Handles btnclear.Click lstdestination.SelectedIndex = -1 lstoutput.Items.Clear() chkhiking.Checked = False chkapplepicking.Checked = False chkelkwatching.Checked = False chkmassage.Checked = False chkballgame.Checked = False chkconcert.Checked = False radsingle.Checked = False raddouble.Checked = False txtname.Clear() mtbreturn.Clear() mtbdeparture.Clear() End Sub Private Sub btnexit_Click(sender As Object, e As EventArgs) Handles btnexit.Click Me.Close() End Sub End Class
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started