// Describe the program

// Any imports
import java.io.*;
import java.util.*;

// class specification
public class DoubleRoundTest {
  public static void main(String[] args) {

    // Initialize

    double doubleVal = Double.parseDouble("123.123456");
    double roundedVal;

    // Output instructions to the user
    // Prompt for data (Show ME the Data!)
    System.out.println("Enter a number to round to the nearest cent or 0 to quit");
    doubleVal = ConsoleInput.readLineDouble();

    // While it's not the end of data
    while (doubleVal != 0.0 )
    {
      // Process the data
      roundedVal = Math.floor(doubleVal * 100.0 + .5) / 100.0;

      // Output some results
      System.out.println(doubleVal + " rounded is: " + roundedVal);

      // Prompt for more data
      System.out.println("Enter a number to round to the nearest cent or 0 to quit");
      doubleVal = ConsoleInput.readLineDouble();
    }

    // Preform the wrap-up processing
    System.out.println("Thank you!");

    // Output any final results

  } // end main
} // end class