import java.util.Scanner;
//=================================================================================================
public class UseH2O {
//-------------------------------------------------------------------------------------------------
    private static final Scanner keyboard = new Scanner(System.in);
//-------------------------------------------------------------------------------------------------
    public static void main(String[] args) {

        double numberOfMoles;
        double temperature;
        double pressure;
        double volume;
        Water water;
        Ice ice;
        Steam steam;

        System.out.print("How many moles of H2O have you got : ");
        numberOfMoles = keyboard.nextDouble();
        System.out.print("What is the water temperature      : ");
        temperature = keyboard.nextDouble();
        System.out.print("What is the steam pressure         : ");
        pressure = keyboard.nextDouble();

        water = new Water(numberOfMoles,temperature);
        ice = new Ice(numberOfMoles);
        steam = new Steam(numberOfMoles,pressure);

        System.out.println(water + " with volume " + water.computeVolume());
        System.out.println(ice + " with volume " + ice.computeVolume());
        System.out.println(steam + " with volume " + steam.computeVolume());

    }
//-------------------------------------------------------------------------------------------------
}
//=================================================================================================
