Goal: Write an application that allows the use to enter the airport of origin, airport of destination and day of week. The application outputs all of the relevant flights, including departure time, arrival time and price.
Input CSV File: A comma separated value file with the fields origin, destination, day, departure, arrival, price: flights.txt.
Input Textboxes (1) Airport Code of Origin, (2) Airport Code of Destination, (3) Day of Week. Include labels for each textbox.
Output Textbox A multiline textbox that outputs the time of departure, time of arrival and price for each flight that matches the input criteria. Set the Multiline property to True for the output textbox.
Submit Button When the submit button is clicked, execute an event handler that reads the input file flights.txt, selecting the files that match the input criteria, and displaying them in the output textbox.
Event Handler Pseudocode
Create StreamReader object. While not at end of file Read line from file using ReadLine method. Get fields array from line using Split method. Get origin, dest, day, departure, arrival, price from fields array. If origin, dest and day match values in input textboxes Then Write formatted departure, arrival, and price to output textbox. End If End While Close StreamReader object.