Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

I want it to be solved using Python programming. It just needs to define following functions. 1. (30 points) The next image is the seating

I want it to be solved using Python programming. It just needs to define following functions.image text in transcribed

1. (30 points) The next image is the seating arrangement of a Bombardier CRJ900 of Delta Connection Fleet 1 2 34 567 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 B1-B4 (in First class). 1 2 3 4567 8 9 10 11 12 13 14 15 16 17 18 19 20 galley t+ lavatory first class delta comfort preferred exit 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 are First class," and the rest form the "Delta Comfort" class. Assume that, if a seat is available, it would have If a seat is taken, its corresponding cell in the two-dimensional list seats will the value of None in it. contain the corresponding ticket number (a string value). 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 ) or 3 (for D") Define the following functions: indicesToSeat(seatRow, seatCol) : returns the corresponding seat number on the airplane. For example the statement shall set s to "B7 isSeatAvailable (seats, 1) s= indicesFromSeat (8, (5 points) seatRow, seatCol) : returns True if the seat in the given . seatRow and seatCol is available. Otherwise, the function returns False. (5 points) 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) findPairAvailable (seats). This function returns a the first two seats that are next two each countAisleSeats (seats) . This function returns the number of aisle seats available in the "Comfort class (5 points)

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

Repairing And Querying Databases Under Aggregate Constraints

Authors: Sergio Flesca ,Filippo Furfaro ,Francesco Parisi

2011th Edition

146141640X, 978-1461416401

More Books

Students also viewed these Databases questions