implements Train class, program5 constructors