Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

please include comments to explain Design classes to handle the data in the Passengers.csv file. Convert each line in the csv file to a single

please include comments to explain

Design classes to handle the data in the Passengers.csv file. Convert each line in the csv file to a single Passenger. Here is an excerpt from the file:

Last,First,Row,Seat lilychu,dat,9,B yuheng,hallen,26,D chau,sangreet,18,A micheal,michelle,7,F

Design classes to support statements:

passenger = Passenger("micheal","michelle",7,'F') jet = Jet(20,16) # 40 rows, 5 seats per rows jet.insert(passenger)

* The Jet contains 40 rows with 5 seats per row. 40 rows and 5 column filled, initially, with empty seats.

* Each Row has seats A thru F for seating assigned Passengers. All the empty Seat objects are pre-inserted in a Jet Row sequentially prior to inserting Passengers. jet.insert inserts a Passenger in a Seat object. Passenger sits in his/her assigned Seat (A-F) in the assigned Row (1 - 40).

After inserting all the passengers in the jet, write code necessary to support statements:

pfound = if passenger in jet: print(pfound)

for i in range(len(jet)): print(jet[i]) # prints a passenger

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

Object Oriented Databases Prentice Hall International Series In Computer Science

Authors: John G. Hughes

1st Edition

0136298745, 978-0136298748

More Books

Students also viewed these Databases questions

Question

Describe the five components of the triggers sheet that Kirk used.

Answered: 1 week ago