previous | start | next

File EarthquakeTest.java

1 import javax.swing.JOptionPane;
2
3 /**
4    A class to test the Earthquake class.
5 */
6 public class EarthquakeTest
7 {  
8    public static void main(String[] args)
9    {  
10       String input = JOptionPane.showInputDialog(
11          "Enter a magnitude on the Richter scale:");
12       double magnitude = Double.parseDouble(input);
13       Earthquake quake = new Earthquake(magnitude);
14       System.out.println(quake.getDescription());
15       System.exit(0);
16    }
17 }


previous | start | next