Question
seatCol = {0: A, 1: B, 3: C, 4: D} seatRow = {0: 1, 2: 1, 3: 2, 4:3, 5: 4, 6: 5, 7: 6,
seatCol = {0: A, 1: B, 3: C, 4: D}
seatRow = {0: 1, 2: 1, 3: 2, 4:3, 5: 4, 6: 5, 7: 6, 8: 7, 9: 8, 10: 9, 11: 10, 12: 11, 13: 12, 14: 13, 15: 14, 16: 15, 17: 16, 18: 17, 19: 18, 20: 19}
count = 0
def indicesToSeat(seatRow, seatCol):
if seatCol == 0:
col = 'A'
elif seatCol == 1:
col = 'B'
elif seatCol == 2:
col = 'C'
elif seatCol == 3:
col = 'D'
else:
print("Enter a number between 0 and 3.")
if (0
row = seatRow +1
else:
print("Enter a number between 0 and 19.")
return (col, row)
def isSeatReserved(seats, seatRow, seatCol):
if seats == None:
return True
else:
return False
# confused
def findIslePairsAvailable(seats):
seats = (seatRow, seatCol)
while ((seatCol == 1 and 2) or (3 and 4)) and (5
if isSeatAvailable == True:
count +=1
else:
return count
#Confused of airplane
def fragmentationCount(seats):
seats = (seatRow, SeatCol)
if (seatCol == 1 or 3) and (5
How do i do this function? Any tips? The last two function Im really confused on how can i do it. Any tips or explanation to this question is helpful?
ints) The next image is the seating of a Bombardier CRJ900 of 2345789 10 11 Connection Fleet seats in rows A and D are called window eats Unlike in the image above, assume that airplane does contain seats B1 B4 (in First s urvaloy class). 2 791011 12 13 14 15 16 12 18 19 20 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 the value of None in it. If a seat is ta contain the corresponding ticket number (a string value). ken, its corresponding cell in the two-dimensional list seats will In what follows: airplane. The parameter seats is the two-dimensional arrays representing the seats on the 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 lane. For example the statement s -indicesFromSeat (8, 1) shall set s to "89" (5 points) ksSeatReserved (seats, seatRow, seatco1) : returns True if the seat in the given seatRow and seatcol is taken. Otherwise, the function returns False. (5 points) "( findIslePairsAvailable (seats). This funtion returns the first isleseat pair (B s function returns the first isle seat pair (B-C) available in the "Comfort" class. A seat pair in row Xis available if BX and CX.(10 points) fragmentation Count(scats): returns the number of available seats that have a reserved seat next to them. For example, if seat B4 is reserved but A4 is not, then seat B4 would be counted as part of the result. This function shall not consider cross-aisle seats. (Hint: search by columns; check only seat pairs A-B and C-D) (10 points) https://www.expressjet.com/assets/Uploads/SeatMaps/dl-crj900.png Page 2 of 5
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started