You are to write a program that allows a user to enter, manipulate,
and print passenger information on airplanes. At a minimum, your program should allow the
user to enter passenger information including first name, last name, phone number,
fare (how much they paid), and approximate weight.
The data should be written to a file named "flight.txt".
When the program starts, it should read the data from this file, and allow modifications
to the data (e.g. add a passenger, remove a passenger).
You may rewrite the file each time. You may assume that the file always exists, although
it would be empty the first time the program is run.
The user should be able to assign passengers to seats and remove passengers from seats.
The user should be able to print a listing of which seats are available/taken.
The user should be able to print a list of all passengers on a plane. The user should be
able to print the total revenue for the flight (sum of all passenger fares), and see the
total weight of passengers on the plane as well as the distribution (how much weight in the
front half of the plane and how much in the back half). You may assume that the plane
has 26 rows of six seats each. A sample list of seats available/taken might look like this (X means taken, A means available):
A B C D E F
1 X A X A A A
2 X A A X X X
3 A X X X A X
4 X A X A A A
5 X A X A A A
6 A X X X A X
7 X A A X X X
8 X A X A A A
9 X A A X X X
10 X A X A A A
11 A X X X A X
12 A A A X A A
13 A A A X A A
14 A A A X A A
15 A A X A A A
16 A A A A A A
17 A A A A A A
18 X A X A A A
19 A A A A A A
20 A A A A A A
21 A A A A A A
22 A A A A A A
23 A A A A A A
24 A A A A A A
25 A A A A A A
26 A A A A A A
Sample seatmap.txt and passenger.txt
files are provided to help you get the formatting correct.
The rest of the user interface will be detailed soon. The file format is up to you.
Your program must implement all of the functions detailed in airplane.h. You must write tests for all of the "Model" functions using the checkit_* functions as appropriate. Write these tests in a separate file named "airplanetests.c". Examples to get you started are given in airplanetests.c. This makefile is given to help you as well.
Be sure to follow the course Code Style, and don't forget to run
andindent -kr -nut airplanetests.c
on your program before handing it in.indent -kr -nut airplane.c
NO collaboration is allowed on this assignment. Everyone must do their own individual work.
You submit two program files named airplane.c and airplanetests.c. Use the vogon handin command:
handin djanzen 101_prog5 airplane.c airplanetests.cComplete this survey.