public class DataFactory
{

  public static ThreeDecimal makeThreeDecimal()
  //pre: true
  //post: returns an instance of the selected implementation of ThreeDecimal,
  //      casted to type ThreeDecimal
  {
    //return (ThreeDecimal)(new TDFraction());

    /* coment the above line and uncomment the below line to switch to
       the TDReal implementation of ThreeDecimal. */

    return (ThreeDecimal)(new TDReal());
  }

}