// purpose: convert Celsius to Fahrenheit using graphical interface and // degree symbols import javax.swing.*; public class DegreeTemperatureConverter { // DEGREE symbol public static String DEGREE = "\u00B0"; // method main(): application entry point for quote display public static void main( String[] args ) { // display the input dialog with a temperature prompt String prompt = "What is the Celsius temperature?"; String input = JOptionPane.showInputDialog( prompt ); // convert string into number int celsius = Integer.parseInt( input ); // compute equivalent int fahrenheit = ( ( 9 * celsius ) / 5 ) + 32; // display result String output = celsius + " C" + DEGREE + " = " + fahrenheit + " F" + DEGREE; JOptionPane.showMessageDialog( null, output ); } }