import java.io.*;
import java.text.*;

/**
 * An example that illustrates the use of the NumberFormat
 * class
 */
public class ChoiceFormatExample
{
    /**
     * The entry point of the application
     *
     * @param args   The command-line arguments
     */
    public static void main(String[] args) throws IOException
    {
	ChoiceFormat          formatter;
	double                grade;
	                      // The intervals are half-open [low, high)
	double[]              limits =       { 0, 60, 70, 80, 90};
	String[]              letterGrades = {"F","D","C","B","A"};
	String                outputString;


	// Note that the constuctor is used (unlike NumberFormat)
	formatter = new ChoiceFormat(limits, letterGrades);

	grade = 82.5;
	outputString = formatter.format(grade);

	System.out.println("Numeric Grade: "+grade);
	System.out.println("Letter  Grade: "+outputString);
    }
}
