// Assignment 2 Helper class
class Helper {

   // This method takes a double value and returns a string
   // representing the value rounded to two decimal places.
   public static String twoDecPlaceString (double number) {

      // Create the string, without decimal places.
      // First, round to the nearest 0.01; then convert to a string
      // by concatenating with the null string.
      String result = "" + (int)(number*100 + 0.5);

      // Then decide where the decimal point should go.
      if (result.length() > 2)
         return result.substring(0,result.length()-2)+ "."
            +result.substring(result.length()-2);
      else if (result.length() == 2)
         return "0."+result;
      else
         return "0.0"+result;
   }
}

