Thanks to visit codestin.com
Credit goes to www.scribd.com

0% found this document useful (0 votes)
118 views2 pages

COMP PROG-Final-project-1

C structure

Uploaded by

Levi Rivaille
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
118 views2 pages

COMP PROG-Final-project-1

C structure

Uploaded by

Levi Rivaille
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 2

Final Requirement in C Programming

SY 2023-2024 - Second Semester


BSCS 1-5

1. Consider small passenger airplane which can accommodate 40 passengers. The small
airplane has 10 rows and 4 columns. Create a seat reservation program that satisfy the
following requirement:

1. A passenger can select a seat. A seat can be reserved by selecting the row
number and column represented by a letter.
1.1. Each row is represented by a sequential row number starting from 1 up
to 10.
1.2. Each column is represented by a letter starting from A to D.
1.3. Seats are marked with corresponding row number and column letter
(see figure 1 below).

Figure 1.

1A 1B 1C 1D
2A 2B 2C 2D
3A 3B 3C 3D
4A 4B 4C 4D
5A 5B 5C 5D
6A 6B 6C 6D
7A 7B 7C 7D
8A 8B 8C 8D
9A 9B 9C 9D
10A 10B 10C 10D

1.4. A passenger can select a seat by getting the row number and the column
letter (Example: 1A, 2A, 1D, etc).
1.5. The selected seat number is marked ‘X’. See Figure 2.
Figure 2.
X 1B 1C X
X 2B 2C 2D
3A 3B 3C 3D
4A 4B 4C 4D
5A 5B 5C 5D
6A 6B 6C 6D
7A 7B 7C 7D
8A 8B 8C 8D
9A 9B 9C 9D
10A 10B 10C 10D
2. A passenger can change (Figure 3) or cancel (Figure 4) the seat previously
reserved. If a passenger has previously reserved 1A and changed it to 1B, the
figure should show the changes in available seats.
Figure 3. A passenger changed seat (from 1A to 1B).
1A X 1C X
X 2B 2C 2D
3A 3B 3C 3D
4A 4B 4C 4D
5A 5B 5C 5D
6A 6B 6C 6D
7A 7B 7C 7D
8A 8B 8C 8D
9A 9B 9C 9D
10A 10B 10C 10D

Figure 4. A passenger cancelled the seat.


1A 2B 1C X
X 2B 2C 2D
3A 3B 3C 3D
4A 4B 4C 4D
5A 5B 5C 5D
6A 6B 6C 6D
7A 7B 7C 7D
8A 8B 8C 8D
9A 9B 9C 9D
10A 10B 10C 10D

3. Save the seat reservation in a file. Reservation, changes, and cancellation


should reflect in the file.
4. Available seats should be available to see by the passenger.
5. If no more available seat, show figure 5 below and the message ‘Airplane is full’.

Figure 5.
X X X X
X X X X
X X X X
X X X X
X X X X
X X X X
X X X X
X X X X
X X X X
X X X X

Airplane is full.

You might also like