You are on page 1of 2

package javaapplication64;

import javax.swing.JOptionPane;

public class Main {

public static void main(String[] args) {

String input= "";

float magnitude;

input=JOptionPane.showInputDialog("Enter the magnitude");

magnitude=Float.parseFloat(input);

if (magnitude<=2.5){

JOptionPane.showMessageDialog(null," minor : not gelt, no damage");}

else if (magnitude<=5.4){

JOptionPane.showMessageDialog(null," moderate: often, felt no damage " );}

else if (magnitude<=6.0){

JOptionPane.showMessageDialog(null," strong: slight damage " );}

else if (magnitude<=6.9){
JOptionPane.showMessageDialog(null," strong; lots of damage " );}

else if (magnitude<=7.9){

JOptionPane.showMessageDialog(null," major; serious damage " );}

else {

JOptionPane.showMessageDialog(null," great: total destruction " );}

You might also like