Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Can someone help me with this question with explanation? Preferred language is python! Thanks 1. (30 points) The next image is the seating arrangement of

Can someone help me with this question with explanation? Preferred language is python! Thanks
image text in transcribed
1. (30 points) The next image is the seating arrangement of a Bombardier CRJ900 of Delta Connection Fleet 1 2 3 4567 8 9 10 11 12 13 14 15 16 17 18 19 20 The seats in rows A and D are called window seats, and the seats in rows B and C are aisle seats. Unlike in the image above, assume that airplane does contain seats Bi-B4 (in First class). EET-RE-.-1-RE a 1 2 3 4567 8910 11 12 13 14 15 16 17 18 19 20 t+ lavatory galley first class delta comfort preferedexit row exit You are hired to help create functions for the reservation and ticketing system for flights on this airplane. Assume the seats are represented using a two-dimensional list, called seats. Assume the first 4 rows First class," and the rest form the "Delta Comfort" class. Assume that, if a seat is available, it would have the value of None in it. If a seat is taken, i contain the corresponding ticket number (a string value). are ts corresponding cell in the two-dimensional list seats will In what follows: . The parameter seats is the two-dimensional arrays representing the seats on the airplane. . The parameter seatRow is a value between 0 and 19; and The parameter seatCol is one of the values 0 (for 'A), (1, for 'B'), 2 (for 'C"') or 3 (for D) Define the following functions: indicestoSeat: (seatRow, seatcol) : returns the corresponding seat number on the airplane. For example the statement s indicesFromSeat (8, 1) shall set s to "B7" (5 points) isseatAvailable (seats, seatRow, seatcol): returns True if the seat in the given seatRow and seatCol is available. Otherwise, the function returns False. (5 points) findPairAvailable(seats). This function returns a the first two seats that are next two each other (either An-Bn, or Cn-Dn, where n is a row number) that are available in the "Comfort" class. If no seats can be found, the function then returns -1. (15 points) countAisleSeats (seats). Thi "Comfort" class (5 points). is function returns the number of aisle seats available in the

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

More Books

Students also viewed these Databases questions

Question

If you think you cant, you wont.

Answered: 1 week ago

Question

Explain the various employee benefit laws.

Answered: 1 week ago

Question

Describe the premium pay benefit practice.

Answered: 1 week ago