Exemple #1
0
print("SOUTH   = " + v1.get_direction())

#IV) Test the inherited turn_right method of Vehicle in Bicycle
print("\nIV) Test the inherited turn_right method of Vehicle in Bicycle")
v1.turn_right()
print("WEST    = " + v1.get_direction())
v1.turn_right()
print("NORTH   = " + v1.get_direction())
v1.turn_right()
print("EAST    = " + v1.get_direction())
v1.turn_right()
print("SOUTH   = " + v1.get_direction())

#V) Test the accelerate and decelerate methods in Bicycle
print("\nV) Test the accelerate and decelerate methods in Bicycle")
v1.accelerate()
print(str(v1.get_top_speed()) + "      = " + str(v1.get_current_speed()))
v1.accelerate()
print(str(v1.get_top_speed()) + "      = " + str(v1.get_current_speed()))
v1.decelerate()
print("0       = " + str(v1.get_current_speed()))
v1.decelerate()
print("0       = " + str(v1.get_current_speed()))

#VI) Test the inherited move method in Bicycle
print("\nVI) Test the inherited move method in Bicycle")
v1.move()
print("(5,-3)  = " + str(v1.get_location()))
v1.accelerate()
v1.move()
print("(5,-28) = " + str(v1.get_location()))