Solved

Visual Basic Assignment. Need help!

Posted on 2013-11-22
6
735 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 69

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
Enabling OSINT in Activity Based Intelligence

Activity based intelligence (ABI) requires access to all available sources of data. Recorded Future allows analysts to observe structured data on the open, deep, and dark web.

 
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

Why You Should Analyze Threat Actor TTPs

After years of analyzing threat actor behavior, it’s become clear that at any given time there are specific tactics, techniques, and procedures (TTPs) that are particularly prevalent. By analyzing and understanding these TTPs, you can dramatically enhance your security program.

Join & Write a Comment

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…
When designing a form there are several BorderStyles to choose from, all of which can be classified as either 'Fixed' or 'Sizable' and I'd guess that 'Fixed Single' or one of the other fixed types is the most popular choice. I assume it's the most p…
As developers, we are not limited to the functions provided by the VBA language. In addition, we can call the functions that are part of the Windows operating system. These functions are part of the Windows API (Application Programming Interface). U…
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…

760 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

Need Help in Real-Time?

Connect with top rated Experts

22 Experts available now in Live!

Get 1:1 Help Now