EDN Admin
Well-known member
Im having a problem getting my program to run, and i have 0 errors...can anyone figure out whats wrong ?
Public Class Qu_3<br/>
<br/>
Private Property tOutPut As Object<br/>
<br/>
Private Sub btnProcess_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnProcess.Click<br/>
Dim FirstName, LastName, Address, City, Invoiceid As String<br/>
Dim Name() As String<br/>
Dim numChair, numSofas As Integer<br/>
Dim cost, salestax, total As Double<br/>
<br/>
<br/>
<br/>
<br/>
<br/>
Calling Event Procedures<br/>
inputdata(Name, Address, City, numSofas, numChair)<br/>
ProcessData(Name, LastName, FirstName, City, invoiceid)<br/>
CalculateCost(numChair, numSofas, cost, salestax, Total)<br/>
<br/>
Display Data<br/>
lstoutput.Items.Clear()<br/>
lstoutput.Items.Add("invoice number" & Invoiceid)<br/>
lstoutput.Items.Add(" ")<br/>
lstoutput.Items.Add("Name:" & LastName & " " & FirstName)<br/>
lstoutput.Items.Add("Address :" & Address)<br/>
lstoutput.Items.Add("city :" & City)<br/>
lstoutput.Items.Add(" ")<br/>
lstoutput.Items.Add("number of chairs" & numChair)<br/>
lstoutput.Items.Add("number of sofas" & numSofas)<br/>
lstoutput.Items.Add("cost:" & cost)<br/>
lstoutput.Items.Add("sales tax " & salestax)<br/>
lstoutput.Items.Add("...............................")<br/>
lstoutput.Items.Add("Total cost" & FormatCurrency(total))<br/>
<br/>
<br/>
<br/>
<br/>
<br/>
<br/>
<br/>
End Sub<br/>
Public Sub inputdata(ByRef name() As String, ByRef address As String, ByRef city As String, ByRef numchairs As Integer, ByRef numsofas As Integer)<br/>
name = txtName.Text.Split(",c")<br/>
address = txtAddress.Text<br/>
city = txtCity.Text<br/>
numchairs = CInt(txtChairs.Text)<br/>
numsofas = CInt(txtSofas.Text)<br/>
End Sub<br/>
Public Sub ProcessData(ByVal name() As String, ByRef lastname As String, ByRef firstname As String, ByVal city As String, ByRef invoiceid As String)<br/>
lastname = name(0)<br/>
firstname = name(1)<br/>
Dim length = city.Length<br/>
invoiceid = lastname.Substring(0, 2).ToUpper<br/>
invoiceid = city.Substring(length - 4, 4)<br/>
<br/>
End Sub<br/>
Public Sub CalculateCost(ByRef numchairs As Integer, ByRef numsofas As Integer, ByRef cost As Double, ByRef salestax As Double, ByRef totalcost As Double)<br/>
Dim chaircost As Double = 350<br/>
Dim sofacost As Double = 925<br/>
cost = (chaircost * numchairs) + (sofacost * numsofas)<br/>
salestax = 0.05 * cost<br/>
totalcost = cost + salestax<br/>
End Sub<br/>
<br/>
<br/>
<br/>
<br/>
<br/>
<br/>
<br/>
<br/>
<br/>
<br/>
<br/>
<br/>
<br/>
Private Sub btnQuit_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnQuit.Click<br/>
Me.Close()<br/>
End Sub<br/>
<br/>
Private Sub btnClear_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnClear.Click<br/>
txtName.Clear()<br/>
txtAddress.Clear()<br/>
txtCity.Clear()<br/>
txtChairs.Clear()<br/>
txtSofas.Clear()<br/>
lstoutput.Items.clear()<br/>
End Sub<br/>
<br/>
Private Sub inputdata(ByVal FirstName As String, ByVal LastName As String, ByVal Address As String, ByVal City As String, ByVal numSofas As Double, ByVal numChair As Double)<br/>
<br/>
End Sub<br/>
<br/>
Private Sub ProcessData(ByVal Name As String, ByVal LastName As String, ByVal FirstName As String, ByVal City As String, ByVal Invoice As String)<br/>
<br/>
End Sub<br/>
<br/>
<br/>
<br/>
<br/>
<br/>
<br/>
<br/>
End Class
View the full article
Public Class Qu_3<br/>
<br/>
Private Property tOutPut As Object<br/>
<br/>
Private Sub btnProcess_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnProcess.Click<br/>
Dim FirstName, LastName, Address, City, Invoiceid As String<br/>
Dim Name() As String<br/>
Dim numChair, numSofas As Integer<br/>
Dim cost, salestax, total As Double<br/>
<br/>
<br/>
<br/>
<br/>
<br/>
Calling Event Procedures<br/>
inputdata(Name, Address, City, numSofas, numChair)<br/>
ProcessData(Name, LastName, FirstName, City, invoiceid)<br/>
CalculateCost(numChair, numSofas, cost, salestax, Total)<br/>
<br/>
Display Data<br/>
lstoutput.Items.Clear()<br/>
lstoutput.Items.Add("invoice number" & Invoiceid)<br/>
lstoutput.Items.Add(" ")<br/>
lstoutput.Items.Add("Name:" & LastName & " " & FirstName)<br/>
lstoutput.Items.Add("Address :" & Address)<br/>
lstoutput.Items.Add("city :" & City)<br/>
lstoutput.Items.Add(" ")<br/>
lstoutput.Items.Add("number of chairs" & numChair)<br/>
lstoutput.Items.Add("number of sofas" & numSofas)<br/>
lstoutput.Items.Add("cost:" & cost)<br/>
lstoutput.Items.Add("sales tax " & salestax)<br/>
lstoutput.Items.Add("...............................")<br/>
lstoutput.Items.Add("Total cost" & FormatCurrency(total))<br/>
<br/>
<br/>
<br/>
<br/>
<br/>
<br/>
<br/>
End Sub<br/>
Public Sub inputdata(ByRef name() As String, ByRef address As String, ByRef city As String, ByRef numchairs As Integer, ByRef numsofas As Integer)<br/>
name = txtName.Text.Split(",c")<br/>
address = txtAddress.Text<br/>
city = txtCity.Text<br/>
numchairs = CInt(txtChairs.Text)<br/>
numsofas = CInt(txtSofas.Text)<br/>
End Sub<br/>
Public Sub ProcessData(ByVal name() As String, ByRef lastname As String, ByRef firstname As String, ByVal city As String, ByRef invoiceid As String)<br/>
lastname = name(0)<br/>
firstname = name(1)<br/>
Dim length = city.Length<br/>
invoiceid = lastname.Substring(0, 2).ToUpper<br/>
invoiceid = city.Substring(length - 4, 4)<br/>
<br/>
End Sub<br/>
Public Sub CalculateCost(ByRef numchairs As Integer, ByRef numsofas As Integer, ByRef cost As Double, ByRef salestax As Double, ByRef totalcost As Double)<br/>
Dim chaircost As Double = 350<br/>
Dim sofacost As Double = 925<br/>
cost = (chaircost * numchairs) + (sofacost * numsofas)<br/>
salestax = 0.05 * cost<br/>
totalcost = cost + salestax<br/>
End Sub<br/>
<br/>
<br/>
<br/>
<br/>
<br/>
<br/>
<br/>
<br/>
<br/>
<br/>
<br/>
<br/>
<br/>
Private Sub btnQuit_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnQuit.Click<br/>
Me.Close()<br/>
End Sub<br/>
<br/>
Private Sub btnClear_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnClear.Click<br/>
txtName.Clear()<br/>
txtAddress.Clear()<br/>
txtCity.Clear()<br/>
txtChairs.Clear()<br/>
txtSofas.Clear()<br/>
lstoutput.Items.clear()<br/>
End Sub<br/>
<br/>
Private Sub inputdata(ByVal FirstName As String, ByVal LastName As String, ByVal Address As String, ByVal City As String, ByVal numSofas As Double, ByVal numChair As Double)<br/>
<br/>
End Sub<br/>
<br/>
Private Sub ProcessData(ByVal Name As String, ByVal LastName As String, ByVal FirstName As String, ByVal City As String, ByVal Invoice As String)<br/>
<br/>
End Sub<br/>
<br/>
<br/>
<br/>
<br/>
<br/>
<br/>
<br/>
End Class
View the full article