Airplane seating chart solution


Original Work


5/5 - (1 vote)

Write a C# console program with the following attributes and functionality:

a)  Create an integer array to represent an airplane seating chart. It has 26 rows and 4 columns. (You can use Boolean. But, it will make logic for the method in c harder.)

b) Create a method called seatPassenger that takes 2 integers named row and col. It checks to see if a seat in the array you created for the seating chart is taken and if it is empty it places a 1 in the position in the array and prints a message for the user. If the seat was already taken it should print a message that the seat was unavailable.


c) Create a method called numberSeated that uses nested loops to add up all of the passengers in the array holding the seating chart and print the value for the user.

d) Create a method called newPlane that uses nested loops to set every position in the array to 0.  

e) Write the rest of the program to test the features in a-d above. Either use a loop to prompt the user for seatPassenger  -or-  call it 3 times. (It is your choice.)  Then call the numberSeated method. Then call the newPlane method, and call the numberSeated method again.