•
•
•
•
What is DaniWeb IT Discussion Community?
You're currently browsing the VB.NET section within the Software Development category of DaniWeb, a massive community of 375,195 software developers, web developers, Internet marketers, and tech gurus who are all enthusiastic about making contacts, networking, and learning from each other. In fact, there are 2,156 IT professionals currently interacting right now! Registration is free, only takes a minute and lets you enjoy all of the interactive features of the site.
Please support our VB.NET advertiser:
Views: 21097 | Replies: 0
![]() |
•
•
Join Date: May 2004
Posts: 7
Reputation:
Rep Power: 0
Solved Threads: 1
I need help with a program. It’s suppose to keep track of motel reservations.
A guest’s name is entered and then assigned to a room. The motel has three floors and 40 rooms (numbered 1 to 40).
The program is suppose to reserve a room, cancel a reservation, and display all the rooms on one floor along with the names of guests who have reserved the rooms. Guest cannot reserve a room that has already been reserved.
One form will be used to display the reservations for one floor, and a separate form will be used for making/canceling reservations. When canceling a reservation, provide some sort of "are you sure" safety check, such as a message box. At least one two-dimensional array is to be used..
The problem I am having is that I’m not sure how to stop the user from reserving a room that has already been reserved.. The program just displays the information entered in. The code is located below. Any help would be apprecaiated.
Public Class Form1
Inherits System.Windows.Forms.Form
Dim HotelArray(3, 40)
Dim intRowNumber As Integer
Dim intColumnNumber As Integer
Dim x As Integer
Dim y As Integer
Dim mblnFloorFound As Boolean = False
Dim mblnRoomFound As Boolean = False
Dim mintRoomSub As Integer
Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
For x = 1 To 3
lstFloor.Items.Add(x)
Next x
End Sub
Private Sub btnReserve_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnReserve.Click
intFloor = CInt(lstFloor.SelectedIndex) + 1
intRoom = CInt(NumericUpDown1.Value)
strName = CStr(txtName.Text)
intRowNumber = intFloor
intColumnNumber = intRoom
HotelArray(intRowNumber, intColumnNumber) = intFloor & " " & intRoom
End Sub
Private Sub btnDisplay_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnDisplay.Click
lstGuestInfo.Items.Add("Floor Number:" & " " & HotelArray(intRowNumber, intColumnNumber) & " " & "Customer Name:" & " " & strName)
End Sub
End Class
A guest’s name is entered and then assigned to a room. The motel has three floors and 40 rooms (numbered 1 to 40).
The program is suppose to reserve a room, cancel a reservation, and display all the rooms on one floor along with the names of guests who have reserved the rooms. Guest cannot reserve a room that has already been reserved.
One form will be used to display the reservations for one floor, and a separate form will be used for making/canceling reservations. When canceling a reservation, provide some sort of "are you sure" safety check, such as a message box. At least one two-dimensional array is to be used..
The problem I am having is that I’m not sure how to stop the user from reserving a room that has already been reserved.. The program just displays the information entered in. The code is located below. Any help would be apprecaiated.
Public Class Form1
Inherits System.Windows.Forms.Form
Dim HotelArray(3, 40)
Dim intRowNumber As Integer
Dim intColumnNumber As Integer
Dim x As Integer
Dim y As Integer
Dim mblnFloorFound As Boolean = False
Dim mblnRoomFound As Boolean = False
Dim mintRoomSub As Integer
Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
For x = 1 To 3
lstFloor.Items.Add(x)
Next x
End Sub
Private Sub btnReserve_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnReserve.Click
intFloor = CInt(lstFloor.SelectedIndex) + 1
intRoom = CInt(NumericUpDown1.Value)
strName = CStr(txtName.Text)
intRowNumber = intFloor
intColumnNumber = intRoom
HotelArray(intRowNumber, intColumnNumber) = intFloor & " " & intRoom
End Sub
Private Sub btnDisplay_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnDisplay.Click
lstGuestInfo.Items.Add("Floor Number:" & " " & HotelArray(intRowNumber, intColumnNumber) & " " & "Customer Name:" & " " & strName)
End Sub
End Class
![]() |
•
•
•
•
Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
•
•
•
•
•
•
•
•
DaniWeb VB.NET Marketplace
- two dimensional array (C)
- Validation with js of two dimensional array (JavaScript / DHTML / AJAX)
- 2 dimensional array class (C)
- multi dimensional array search xml parser (PHP)
- Need help passing a multi-dimensional array (C++)
- Trying to create a method to convert string letters into a two dimensional array (Java)
Other Threads in the VB.NET Forum
- Previous Thread: VB and Excel Programming
- Next Thread: Need Help for identify the Sorting Action


Linear Mode