i'm not entirely sure what is wrong with this java. i kept getting incompatible type when i run the program. I am only a beginner in java program. Please give me a hand in detail. i have tried various method and searched for many links in google. but i was just unfortunate. Write a program that asks the user to enter “air”, “water”, or “steel”, and the distance that a sound wave will travel in the medium. The program should then display the amount of time it will take.
Prompts And Output . The program prompts for the medium with: "Enter one of the following: air, water, or steel: " and reads the medium. If the medium is not air, water or steel the program prints the message : "Sorry, you must enter air, water, or steel." an nothing else. Otherwise the program prompts for the distance with ("Enter the distance the sound wave will travel: " and reads it in and then prints "It will take x seconds." where x is the time calculated by your program .
and this is what I have so far.
class one{ 
    public static void main(String[] args){ 
        Scanner input = new Scanner(System.in);
        System.out.print("Enter one of the following: air, water, or steel: ");
        String text = input.nextLine();
        System.out.print("Enter the distance the sound wave will travel: ");
        double distance;
        double time;
        distance = input.nextDouble();
        switch (text){
            case "air":
                time = (distance/1100);
                System.out.println("It will take " + time + " sconds." );
                break;
            case "water":
                time = (distance/4900);
                System.out.println("It will take " + time + " seconds.");
                break;
            case "steel":
                time = (distance/16400);
                System.out.println("It will take " + time + " seconds.");
                break;
            default:
                System.out.println("Sorry, you must enter air, water, or steel.");
        }    
    }
}
 
     
     
     
    