Imagine a world where our transportation is not just confined to roads or waters but can be both. In this innovative setting, we need a transport device that can function both on roads and on water bodies.
To meet this need, you are tasked to design two base classes Car and Boat, and a derived class Amphibian, which will inherit from both base classes.
The Car class should have a method drive(distance), that when invoked, increases the car's odometer reading by the given distance and returns the new reading.
The Boat class should have a method sail(distance), that when invoked, increases the boat's odometer reading by the given distance and returns the new reading.
The Amphibian class should inherit the drive() and sail() methods, and should be able to invoke both. It should also keep track of the total distance traveled, whether by road or water.
The total_distance() method should return the total distance covered by the amphibian vehicle, combining the distances covered on road and water.