2
answers
0
watching
105
views
9 Jul 2018
Part (b) [2 MARKS] Here is the header, type contract, and description for method log_trip in class Airplane. Add an example that creates an Airplane object, logs a trip of 1000.0 miles, and shows that those miles have been logged. Also write the body of the method. def log_trip(self, num_miles): (Airplane, float) -> None Type Precondition: num_miles > 0.0 Record that the airplane travelled num_miles additional miles.
Part (b) [2 MARKS] Here is the header, type contract, and description for method log_trip in class Airplane. Add an example that creates an Airplane object, logs a trip of 1000.0 miles, and shows that those miles have been logged. Also write the body of the method. def log_trip(self, num_miles): (Airplane, float) -> None Type Precondition: num_miles > 0.0 Record that the airplane travelled num_miles additional miles.
29 Jun 2023
Tod ThielLv2
10 Jul 2018
Already have an account? Log in