Solved

Visual Basic Assignment. Need help!

Posted on 2013-11-22
6
750 Views
Last Modified: 2013-11-22
Instruction : Woody Real Estate HW5
Outcome : Must be same with HW5 0101-Hellow_World
Visual Basic File : HW5-0101-Jong-Lee

Hi I totally get lost from #11 to #13 (Instruction)
Could you please write down codes for me?
I really need your help as soon as possible!

Thank you!

--From number 11

    Private Funtion SearchFrom(ByVal startIndex As integer,
                    Byval bedroom as Integer,
                    ByVal bathroom As Integer,
                    ByVal proptate As String) As Integer

    Private Sub searchButton_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles searchButton.Click

    End Sub

    Private Sub searchNextButton_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles searchNextButton.Click

    End Sub
End Class
Woody-Real-Estate-HW5.docx
HW5-0201-Jong-Lee.vbproj
0
Comment
Question by:John_Lef
  • 3
  • 2
6 Comments
 
LVL 70

Expert Comment

by:Éric Moreau
ID: 39668745
Try to do your own homework and come back with exact questions. If we do it all for you, you will never learn!
0
 
LVL 85

Assisted Solution

by:Mike Tomlinson
Mike Tomlinson earned 500 total points
ID: 39668819
The instructions are pretty good...what's the problem?

Did you add the function to your code?

Basically you just need to iterate over the arrays until you find a match, or return -1 if no match is found.

If you don't know how to write a For loop, look here or here.

Or you could just use this code instead:
    Private Function SearchFrom(ByVal startIndex As Integer, _
                    ByVal bedroom As Integer, _
                    ByVal bathroom As Integer, _
                    ByVal proptate As String) As Integer

        MessageBox.Show("You can't afford a House!")
        Return -1

    End Function

Open in new window

0
 

Author Comment

by:John_Lef
ID: 39668849
Can you please show me one example?
I know only basic For Loop, so i dont know how to apply it here
0
Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 
LVL 85

Assisted Solution

by:Mike Tomlinson
Mike Tomlinson earned 500 total points
ID: 39668878
I did give you an example, TWO of them in fact.  Follow the links..,

The first link just shows how to write a generic For loop.
The second link, in Example 2, actually has a For loop that accesses an Array called "rabbits".
0
 

Author Comment

by:John_Lef
ID: 39668953
Oh okay i got it!
I have a final question for #12

    Private Sub searchButton_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles searchButton.Click
        Dim bedroomSearch As Integer = CInt(bedroomComboBox.SelectedItem)
        Dim bathroomSearch As Integer = CInt(bathroomComboBox.SelectedItem)
        Dim stateSearch As String = CStr(stateComboBox.SelectedItem)
        Dim searchResult As Integer

        searchResult = SearchFrom(0, bedroomSearch, bathroomSearch, stateSearch)

        If searchResult = -1 Then
            MessageBox.Show("Not found!")
        End If
    End Sub

Is there any other way to do #12? I wonder if there is easiler way to do this.
0
 
LVL 85

Accepted Solution

by:
Mike Tomlinson earned 500 total points
ID: 39669014
Doesn't get much simpler than that.

If -1 is NOT returned, though, then you should probably display the search result somewhere!  ;)
0

Featured Post

Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

The debugging module of the VB 6 IDE can be accessed by way of the Debug menu item. That menu item can normally be found in the IDE's main menu line as shown in this picture.   There is also a companion Debug Toolbar that looks like the followin…
You can of course define an array to hold data that is of a particular type like an array of Strings to hold customer names or an array of Doubles to hold customer sales, but what do you do if you want to coordinate that data? This article describes…
Get people started with the process of using Access VBA to control Outlook using automation, Microsoft Access can control other applications. An example is the ability to programmatically talk to Microsoft Outlook. Using automation, an Access applic…
Get people started with the utilization of class modules. Class modules can be a powerful tool in Microsoft Access. They allow you to create self-contained objects that encapsulate functionality. They can easily hide the complexity of a process from…

685 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question