This document discusses enabling assessment on dialog boxes in Java. It provides code to import necessary Java classes like Scanner, JDialog, and JOptionPane. The code then prompts the user to enter a desired grade, formats it to 3 decimal places, and displays it in a warning message dialog box using JOptionPane. The program exits normally after displaying the message dialog.
This document discusses enabling assessment on dialog boxes in Java. It provides code to import necessary Java classes like Scanner, JDialog, and JOptionPane. The code then prompts the user to enter a desired grade, formats it to 3 decimal places, and displays it in a warning message dialog box using JOptionPane. The program exits normally after displaying the message dialog.
This document discusses enabling assessment on dialog boxes in Java. It provides code to import necessary Java classes like Scanner, JDialog, and JOptionPane. The code then prompts the user to enter a desired grade, formats it to 3 decimal places, and displays it in a warning message dialog box using JOptionPane. The program exits normally after displaying the message dialog.
DIRECTION: Fill-in the blanks with the correct Java command or statement. The output is displayed for your reference.
import java. util . Scanner;
import javax.swing. JDialog ; //do not use * to import all classes import javax.swing. JOptionPane ; //do not use * to import all classes import java.text . DecimalFormat;
public class Quiz {
public static void main ( String args[ ] ) { Scanner input = new Scanner ( System.in ); DecimalFormat f = new DecimalFormat ( 0.000 ); //format with 3 decimals double grade; System.out.print("Enter your desired grade: ");