public String constructTrainLength(String trainName) throws IOException {
  Train train=tm.getTrainByName(trainName);
  if (train != null) {
    return String.valueOf(train.getTrainLength());
  }
  sendErrorStatus("ERROR train name doesn't exist " + trainName);
  return null;
}

public String constructTrainLength ( String trainName ) throws IOException { Train train = tm . getTrainByName ( trainName ) ; if ( train != null ) { return String . valueOf ( train . getTrainLength ( ) ) ; } sendErrorStatus ( "ERROR train name doesn't exist " + trainName ) ; return null ; }
constructs a string containing the length of a train
