Answered step by step
Verified Expert Solution
Question
1 Approved Answer
Based on the Python programming assignment enterprise: a) Write Python code to define a Domestic class that inherits from Flight , adding an instance variable
Based on the Python programming assignment enterprise:
a) Write Python code to define a Domestic class that inherits from Flight, adding an instance variable excisetax that represents a tax rate, such as .075. You must follow Python naming conventions and include:
- a constructor for Domestic that accepts all of its instance variables, including inherited ones.
- a get_excisetax accessor method for Domestics instance variable
b) Assuming that a variable my_flight is bound to an instance of a Domestic flight, write a Python print statement that displays the date associated with my_flight.
Recall the Python Programming enterprise of Airline, Airport, and Flight objects where the input data was organized into the following dictionaries: 1. airline_dict[airline_code] = Airline object 2. airport_dict[airport_code] = Airport object 3. date_dict[yyyy-mm-dd] = list of Flight objects on that date ordered by scheduled departure time Flight Airport _code: str _name: str _city: str _state: str _origin_flights: list #Flight _dest_flights: list # Flight _init__(self, con, c, s) add_origin_flight(self, flight) add_dest_flight(self, flight) _repr_(self) _date: str #yyyy-mm-dd _year: int _month: int _day: int _airline: Airline _flight_num:int _origin_airport: Airport _dest_airport: Airport _scheduled_departure: int _departure_time:int _departure_delay: int _scheduled_arrival: int _arrival_time:int _arrival_delay: int 6 getter methods: 1 for each private instance variable _init__(self, y, m, d, al, fn, oa, da, sd, dt, dd, sa, at, ad) _repr_(self) Airline _code: str _name: str _flights: list #Flight 14 getter methods: 1 for each private instance variable named: get_vname # one underscore _init__(self, c, n) add_flight(self, flight) _repr_(self) 3 getter methods: 1 for each private instance variable
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