Question: Using C not C++ and not using arrays to store data only pointers through a linked list (50 points) Your task is to create a

Using C not C++ and not using arrays to store data only pointers through a linked list

(50 points) Your task is to create a sorted list (by flight number) of flights with the information provided by the Flights.txt file that is provided as part of this assignment. The flight data consists of: airlines, flight number, arrival time, and departure time. You must also prompt the user to see if there is a flight to be deleted, once you have them in your linked list. The user can select a flight number and you must delete that flight from the linked list, and reprint the list. Continue asking the user if they want to delete a flight until the user types in Q or q. Then exit the program.

1.) The Flights.txt file name should be used as an argument to your program from the command line. Flights.txt should not be hard coded into your program. I will use a differently named text file to test your code. The file I use may also have a different number of flights.

2.) You must read each line of the file, putting each flight into a structure, that is then used to create a linked list of flights.

3.) You are not allowed to use any arrays to store your data, only the linked list.

4.) You must keep the linked list in a sorted order so that as you read the flights, you can insert the new flight into the correct place in the linked list. Also, when you delete a flight, the list should still be in order.

5.) Print each flight as you read it into your program, then print the final sorted list before ending your program.

6.) Functions should be used to insert, print, and delete the flight structures.

7.) You should use the following functions at a minimum (these functions may be similar to assignment 4 problem 3). Feel free to change these function prototypes to suit your program.

void Insert(struct Flight *f, struct Flight *head)

void Delete(struct Flight *f)

void PrintList(struct Flight *head)

Using C not C++ and not using arrays to store data onlypointers through a linked list (50 points) Your task is to create

The flight list:

AA 2415 2015 2135 AM 0045 1500 1615 DT 0123 1230 1320 FR 1440 1000 1100 SW 0013 0800 0905 JB 3626 0721 0830 UN 4452 0740 0840 AA 7786 2254 2132 AM 2184 2225 2345 DT 0596 1551 1630 FR 5378 1150 1300 SW 9959 1601 1710 JB 8849 2028 2145 UN 6110 0805 1000 AA 1381 0857 1110 AM 7333 1142 1300 DT 1857 0958 1540 FR 8011 1721 1835 SW 8524 2006 2100 JB 7098 1452 1550 UN 7916 1405 1530 HN 876 1159 1430 DL 345 0730 0815 AL 366 0800 0950 RS 7322 0745 1000 JK 23 1230 1405 LO 238 600 0745 OP 8763 1600 1740 LK 987 0935 1200 MN 678 1020 1130 LN 543 2200 2330

be useful as well, Sample input/output: lastname-HW4-Probl.exe Flights.txt Inserting flight: AA 2415 2015 2135 Inserting flight: AM 45 1500 1615 Inserting flight: DT 123 1230 1320 Inserting flight: FR 1440 1000 1100 Inserting flight: SW 13 800 905 Inserting flight: JB 3626 721 830 Inserting flight: UN 4452 740 840 Inserting flight: AA 7786 2254 2132 Inserting flight: AM 2184 2225 2345 Inserting flight: DT 596 1551 1630 Inserting flight: FR 5378 1150 1300 Inserting flight: SW 9959 1601 171e Inserting flight: JB 8849 2028 2145 Inserting flight: UN 6110 805 1000 Inserting flight: AA 1381 857 1110 Inserting flight: AM 7333 1142 1300 Inserting flight: DT 1857 958 1540 Inserting flight: FR 8011 1721 1835 Inserting flight: SW 8524 2006 2100 Inserting flight: JB 7098 1452 155e Inserting flight: UN 7916 1405 1530 Inserting flight: HN 876 1159 1430 Inserting flight: DL 345 730 815 Inserting flight: AL 366 800 95e Inserting flight: RS 7322 745 1000 Inserting flight: JK 23 1230 1405 Inserting flight LO 238 600 745 Inserting flight: OP 8763 1600 1740 Inserting flight: LK 987 935 1200 Inserting flight: MN 678 1020 1130 Inserting flight: LN 543 2200 2330 Flight list: SW 13 800 905 JK 23 1230 1405 AM 45 1500 1615 123 123? 1320 LO 238 600 745 L 345 730 815 AL 366 800 95

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!