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          myChoiceFormat;
	double                grade;
	                      // The intervals are half-open [low, high)
	double[]              limits =       { 0, 60, 70, 80, 90};
	String[]              letterGrades = {"F","D","C","B","A"};
	String                myStringData;


	// Note that the constuctor is used (unlike NumberFormat)
	myChoiceFormat = new ChoiceFormat(limits, letterGrades);
   
	System.out.println (" Please enter an grade and hit return ");
	grade = Keyboard.readDouble();
   
	myStringData = myChoiceFormat.format(grade);

	System.out.println("Numeric Grade: "+grade);
	System.out.println("Letter  Grade: "+myStringData);
  }
}
