can anyone help me plz ,,plz with my project which is
Project Title:
Simple Flight Seating Arrangement Program.
Description:
The seating arrangement of a flight is stored in a data file flight.txt containing five lines. Each line
contains four integers, a value of 1 represents a reserved seat, and a value of 0 represents an empty
seat. The following is an example of the contents of flight.txt:
0 1 1 1
1 1 0 0
0 0 0 1
1 1 1 1
1 0 1 0
Write an interactive program which has a menu with the following options:
1. Show number of empty seats
2. Show empty seats
3. Reserve a seat
4. Cancel a seat
5. Exit the program
The program first reads the data file flight.txt and stores the data in one-dimensional integer array
seats of size 20, then:
a. If option 1 is chosen, the main function passes the array seats to an integer function NEMPTY
which returns the number of empty seats. Then the main function prints this number.
b. If option 2 is chosen, the main function passes the array seats to a void function ESEATS
which prints the positions of all empty seats. The seat position means the row number and the
column number of the seat.
c. If option 3 is chosen, the user is prompted to enter the row number and the column number of
the seat to be reserved. The main function then passes these two numbers together with the
array seats to a logical function RESERV which reserves a seat if it is empty and returns the
value true (1) to the main function. If the requested seat is already reserved or if the row or
column number is out of range, the function returns the value false (0) to the main function. The
main function then prints the message SEAT RESERVED or SEAT NOT AVAILABLE
respectively.
d. If option 4 is chosen, the user is prompted to enter the row number and the column number of
the seat to be canceled. The main function then passes these two numbers together with the
array seats to a logical function CANCEL which cancels a seat if it is reserved and returns the
value true (1) to the main function. If the requested seat is already empty or if the row or
column number is out of range, the function returns the value false (0) to the main function. The
main function then prints the message SEAT CANCELED or WRONG CANCELLATION
respectively.
e. If option 5 is chosen, the main function stops immediately if no changes were made to the array
seats. Otherwise, the main function closes the data file flight.txt and then opens it again for
writing to write into it the new seating arrangement stored in the array seats before stopping. It
should write back the data in five lines. Each line should contain four integers with at least one
space between the numbers.
In addition, it is obvious that the program should handle the most common errors possible to
happen such as wrong input, out of range, try to use the seats already reserved or already canceled,
and many others.
Hints:
• Given the seat position as row number n and column number m, the corresponding array
subscript i can be calculated as follows:
i = (n – 1) * 4 + (m - 1)
For example, the status of seat (2,4) is sorted in seats[7].
• Given the array subscript i, the corresponding seat position as row number n and column
number m can be calculated as follows:
n = (i / 4) + 1
m = (i % 4) + 1
For example, seats[12] contains the status of seat (4,1).
Where 1 ≤ n ≤ 5, 1 ≤ m ≤ 4, 0 ≤ i ≤ 19, and status means reserved (value 1) or empty (value 0).