python: Write a program with a class definition 'Aircraft'. The constructor should take in arguments for tail_number, latitude, longitude, altitude, heading, and speed. These should be stored in a dictionary. The key is the parameter name (e.g. 'tail_number'), and the value will be the argument passed to the constructor (e.g. 'N51123ND'). Also have a method definition in the class called 'print_plane', which prints out all of these values for a given instantiation of the class. In the main portion of the program, have an initially-empty list called 'airplanes'. Have the user enter the arguments listed above, call the constructor, and add the new object to the list. Do this three times, so that there will be a list with three instantiations of the Aircraft class in it. Finally, use a 'for' loop to iterate over the list, calling the print_plane method from each object in the list.
python: Write a program with a class definition 'Aircraft'. The constructor should take in arguments for tail_number, latitude, longitude, altitude, heading, and speed. These should be stored in a dictionary. The key is the parameter name (e.g. 'tail_number'), and the value will be the argument passed to the constructor (e.g. 'N51123ND'). Also have a method definition in the class called 'print_plane', which prints out all of these values for a given instantiation of the class. In the main portion of the program, have an initially-empty list called 'airplanes'. Have the user enter the arguments listed above, call the constructor, and add the new object to the list. Do this three times, so that there will be a list with three instantiations of the Aircraft class in it. Finally, use a 'for' loop to iterate over the list, calling the print_plane method from each object in the list.
Trending now
This is a popular solution!
Step by step
Solved in 4 steps with 4 images