Two-dimensional array visual basic?
-
I'm stuck on the VB Airplane Seat reservation. The one I have to do seems a little bit different than the ones I have seen online. Write a reservation system for an airline flight. Assume the airplane has 10 rows with 4 seats in each row. Input by a text file a two-Dimensional array of strings to maintain a seating chart. Allow the user the following options: a. Add a passenger to the flight or waiting list. i. request the passenger’s name. ii. display a chart of the seats in the airplane in tabular form iii. if seats are available, let the passenger choose a seat. Add the passenger to the seating chart iv. if no seats are available, place the passenger on the waiting list, place the passenger on the waiting list b. Remove a passenger from the flight i. request the passenger’s name ii. search the seating chart for the passenger’s name and delete it iii. if the waiting list is empty, update the array so the seat is available iv. if the waiting list is not empty, remove the first person from the list, and give him or her newly vacated seat. Arrays in general are really kicking my butt. All I can come up with for code so far is this but it simply adds the names I enter one after the other in the list box, not in a chart format like I need it too. Private Sub btnAddName_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnAddName.Click Dim nameOf As String = InputBox("Enter Name") Dim row, seat As Integer row = CInt(mtbRow.Text) seat = CInt(mtbSeat.Text) For r = 0 To passengerSeats.GetUpperBound(0) For c = 0 To passengerSeats.GetUpperBound(0) passengerSeats(row, seat) = nameOf Next Next lstNames.Items.Add(nameOf) End Sub
-
Answer:
OK. This may take a while. I'll email you once I'm done.
Luke at Yahoo! Answers Visit the source
Related Q & A:
- What are the object-oriented features of Visual Basic.NET?Best solution by msdn.microsoft.com
- How do you create a Two-Dimensional ArrayList?Best solution by Stack Overflow
- Can you program Graphics with Visual Basic?Best solution by Yahoo! Answers
- What are the main parts of visual basic 2005?Best solution by msdn.microsoft.com
- Codes for a simple visual basic program.Best solution by vbtutor.net
Just Added Q & A:
- How many active mobile subscribers are there in China?Best solution by Quora
- How to find the right vacation?Best solution by bookit.com
- How To Make Your Own Primer?Best solution by thekrazycouponlady.com
- How do you get the domain & range?Best solution by ChaCha
- How do you open pop up blockers?Best solution by Yahoo! Answers
For every problem there is a solution! Proved by Solucija.
-
Got an issue and looking for advice?
-
Ask Solucija to search every corner of the Web for help.
-
Get workable solutions and helpful tips in a moment.
Just ask Solucija about an issue you face and immediately get a list of ready solutions, answers and tips from other Internet users. We always provide the most suitable and complete answer to your question at the top, along with a few good alternatives below.