I am creating a java program that would do some conversion, unfortunately i can't make it work. Can anyone help me? Here's my code
If the first conversion works then i can do the rest. Please help me! ASAP!package If_then_Else; import javax.swing.*; public class If_then_Else { static final double km_per_miles = 1.6093; static final double meter_per_miles = 1.6093; static final double feet_per_miles = 5279.85565107; static final double inches_per_miles = 63358.26781284; static final double cm_per_miles = 160930.0002446136; static final double miles_per_km = 0.6213882; static final double meter_per_km = 1000; static final double feet_per_km = 3280.8399; static final double inches_per_km = 39370.07; static final double miles_per_meter = 621.3882; static final double km_per_meter = 1000; static final double feet_per_meter = 3.280839; static final double inches_per_meter = 39.3700788; static final double cm_per_meter = 100; static final double miles_per_feet = 0.0001893991176; static final double km_per_feet = 0.0003048; static final double meter_per_feet = 0.3048; static final double inches_per_feet = 12; static final double cm_per_feet = 30.48; static final double miles_per_inches = 0.000015783254; static final double km_per_inches = 0.000025349; static final double meter_per_inches = 0.02534; static final double feet_per_inches = 0.08333; static final double cm_per_inches = 2.51; static final double miles_per_cm = 0.000006218797; static final double km_per_cm = 0.000004; static final double meter_per_cm = 0.004; static final double feet_per_cm = 0.032808386877; static final double inches_per_cm = 0.3937008; public static void main(String[] args) { System.out.println("Choose a Conversion:"); System.out.println("1. Miles"); System.out.println("2. Kilometers"); System.out.println("3. Meter"); System.out.println("4. Feet"); System.out.println("5. Inches"); System.out.println("6. Centimeters"); System.out.println("7. Exit"); String opt = JOptionPane.showInputDialog(null, "Choice:"); if (opt == 1) { System.out.println("Number of Kilometers:"); String milesStr; double km; double miles; milesStr = JOptionPane.showInputDialog(null, "Number of Kilometers:"); miles = Double.parseDouble(milesStr); km = miles * km_per_miles; JOptionPane.showMessageDialog(null, "km " + km + " miles."); } else if (opt == 2){ System.out.println("Number of Miles:"); } else if (opt == 3){ System.out.println("Number of Miles:"); } else if (opt == 4){ System.out.println("Number of Miles:"); } else if (opt == 5){ System.out.println("Number of Miles:"); } else if (opt == 6){ System.out.println("Number of Miles:"); } } }