Hey there I am struggle with importing a existing class in PYTHON  in the order below for class PLANE   (Landingspot CLASS with objects ID, city, country )and am trying to import to another class module PLANE(flightNumber, Start, goingTo). Each class would be eventually reading from text files with some spaces and commas separating randomly.   'As suggested by its name, this class represents a Plane from one landingSpot to another landingSpot in the program. Each Plane object must have a flightNumber (the unique 6-character code containing 3 letters followed by 3 digits), Start place, and a goingTo. Both the Start and goingTo must be LandingSpot objects within the program.'   Landingspot Ex textfile contains JFK,UnitedStates,   NewYork PHL,UnitedStates,Philadelphia etc   Class Plane EX text file contains KPP582,YYZ,ICN VDT680,JRS,PHL XPA230,YEG,ORD   XGY802,    YUL,GIG JHW048,ORD,NBO KGM892,SYD,JRS XUC141,JFK,    DEN RIN900,FCO,PEK EKR896,SFO,         YHZ     First class I have finished   Class Landingsport (self, ID, country, city)      self.ID= ID       self.country = country       self.city = city REPR Getters and setter done    ****but when I get to the other class I find issues

Computer Networking: A Top-Down Approach (7th Edition)
7th Edition
ISBN:9780133594140
Author:James Kurose, Keith Ross
Publisher:James Kurose, Keith Ross
Chapter1: Computer Networks And The Internet
Section: Chapter Questions
Problem R1RQ: What is the difference between a host and an end system? List several different types of end...
icon
Related questions
Question

Hey there I am struggle with importing a existing class in PYTHON  in the order below for class PLANE

 

(Landingspot CLASS with objects ID, city, country )and am trying to import to another class module PLANE(flightNumber, Start, goingTo). Each class would be eventually reading from text files with some spaces and commas separating randomly.

 

'As suggested by its name, this class represents a Plane from one landingSpot to another landingSpot in the program.

Each Plane object must have a flightNumber (the unique 6-character code containing 3 letters followed by 3 digits), Start place, and a goingTo. Both the Start and goingTo must be LandingSpot objects within the program.'

 

Landingspot

Ex textfile contains

JFK,UnitedStates,   NewYork

PHL,UnitedStates,Philadelphia

etc

 

Class Plane EX text file contains

KPP582,YYZ,ICN

VDT680,JRS,PHL

XPA230,YEG,ORD

  XGY802,    YUL,GIG

JHW048,ORD,NBO

KGM892,SYD,JRS

XUC141,JFK,    DEN

RIN900,FCO,PEK

EKR896,SFO,         YHZ

 

 

First class I have finished

 

Class Landingsport (self, ID, country, city)

     self.ID= ID

      self.country = country

      self.city = city

REPR

Getters and setter done 

 

****but when I get to the other class I find issues

 

Second class

 

From landingSpot import *

 

 class Plane

 

*import from Landingspot as it makes use of Landingspot objects; add the line from Landingspot import *

 

__init__(self, flightNumber, Start, goingTo):

 First check that both Start and goingTo are Airport objects : use the isinstance operator).

If either or both are not Plane objects, raise a TypeError that states "The Start and goingTo must be plane objects"

 

 When the Start and goingTo are both Plane objects, proceed to initialize the instance variables _flightNumber, _start, and _goingTo based on the corresponding parameters in the constructor

 

  __repr__(self):

o Return the representation of this Plane  - containing the flightNo, origin city, and destination city, and an indication of whether the Flight is  international or domestic  (see the isDomesticFlight method description below). The representation must be in the following format: Plane: flightNumber from startCity to goingToCity {domestic/international}

 

EX Flight: MLK523 from London to Manchester {domestic}

EX  Flight: WBQ345 from London to Chicago {international}

 

 __eq__(self, other):

 Method that returns True if self and other are considered the same Flight: if the origin and destination are the same for both Flights. Make sure that if “other” variable is not a Flight object, this means False should be returned.

 

 getFlightNumber(self):

 Getter that returns the Flight number

 

getStart(self):

Getter that returns the Plane Start

 

 getgoingTo(self):

 Getter that returns the Plane destination

 

 isDomesticFlight(self): 

Method that returns True if the flight is domestic, EX within a country (the Start and goingTo are in the same country); returns False if the flight is international (the Start and goingTo are in different countries)

 

 setStart(self, origin):

Setter that sets (updates) the Plane Start

 

 setgoingTo(self, destination):

Setter that sets (updates) the Plane GoingTo

Expert Solution
steps

Step by step

Solved in 3 steps

Blurred answer
Knowledge Booster
Developing computer interface
Learn more about
Need a deep-dive on the concept behind this application? Look no further. Learn more about this topic, computer-engineering and related others by exploring similar questions and additional content below.
Recommended textbooks for you
Computer Networking: A Top-Down Approach (7th Edi…
Computer Networking: A Top-Down Approach (7th Edi…
Computer Engineering
ISBN:
9780133594140
Author:
James Kurose, Keith Ross
Publisher:
PEARSON
Computer Organization and Design MIPS Edition, Fi…
Computer Organization and Design MIPS Edition, Fi…
Computer Engineering
ISBN:
9780124077263
Author:
David A. Patterson, John L. Hennessy
Publisher:
Elsevier Science
Network+ Guide to Networks (MindTap Course List)
Network+ Guide to Networks (MindTap Course List)
Computer Engineering
ISBN:
9781337569330
Author:
Jill West, Tamara Dean, Jean Andrews
Publisher:
Cengage Learning
Concepts of Database Management
Concepts of Database Management
Computer Engineering
ISBN:
9781337093422
Author:
Joy L. Starks, Philip J. Pratt, Mary Z. Last
Publisher:
Cengage Learning
Prelude to Programming
Prelude to Programming
Computer Engineering
ISBN:
9780133750423
Author:
VENIT, Stewart
Publisher:
Pearson Education
Sc Business Data Communications and Networking, T…
Sc Business Data Communications and Networking, T…
Computer Engineering
ISBN:
9781119368830
Author:
FITZGERALD
Publisher:
WILEY