Question

In: Computer Science

Water changes between solid phase (as ice) and liquid phase at 0℃. and between liquid phase and gas phase (as water vapor) at 100 ℃.

 
Water changes between solid phase (as ice) and liquid phase at 0℃. and between liquid phase and gas phase (as water vapor) at 100 ℃. Write a program to accept a temperature front keyboard, and display the corresponding water phase (solid, liquid or gas) under that temperature.

Solutions

Expert Solution


import java.util.*;
import java.lang.*;
import java.io.*;
import java.util.Scanner;

public class WaterState
{

public static void main (String[] args) throws java.lang.Exception

{
boolean run = true;
while(run)
{
Scanner scan = new Scanner(System.in);

System.out.println("What is the temperature in degrees Celsius?");
double temp = scan.nextDouble();
  
  
String state = "liqud";
if (temp <= 32)
state = "solid";
else if(temp >= 212)
state = "gas";

state = " Water is " + state;
  
System.out.println(state);
}

}

}


Related Solutions

100 g of solid ice at 0°C is added to 500 g of liquid water at...
100 g of solid ice at 0°C is added to 500 g of liquid water at 90°C. What is the final temperature? What is initial water temperature is required so that 10 g of ice remain once equilibrium has been reached?
In this phase diagram for water, indicate the direction that the solid-liquid and liquid-gas coexistence lines...
In this phase diagram for water, indicate the direction that the solid-liquid and liquid-gas coexistence lines will move after the addition of solute.
A sample of water in the vapor phase (no liquid present) in a flask of constant...
A sample of water in the vapor phase (no liquid present) in a flask of constant volume exerts a pressure of 403 mmHg at 99°C. The flask is slowly cooled. i) Assuming no condensation, use the Ideal Gas Law to calculate the pressure of the vapor at 91°C; at 75°C. ii) Will condensation occur at 91°C? 75°C? iii) On the basis of your answers in i) and ii), predict the pressure exerted by the water vapor in the flask at...
Give an example of a vapor-liquid phase diagram and explain the difference in liquid and vapor...
Give an example of a vapor-liquid phase diagram and explain the difference in liquid and vapor composition at a given temperature during the distillation process.
Water at 0.15 MPa if the water is 0.25% between liquid and vapor what is the...
Water at 0.15 MPa if the water is 0.25% between liquid and vapor what is the specific volume, Energy, Enthalpy and Entropy?
In the video, you can see that when heat is applied to a solid it is converted into the liquid phase and then into the gas phase.
In the video, you can see that when heat is applied to a solid it is converted into the liquid phase and then into the gas phase. This process can be studied by plotting the graph of temperature versus the time during which heat is applied to the system. Using this information, arrange the average kinetic energy of the molecules for the following options in decreasing order. Rank from the highest to lowest. To rank items as a equivalent, overlap them.
Ice floats on water. For most other substances however, the solid sinks in the liquid.
 Ice floats on water. For most other substances however, the solid sinks in the liquid. Classify each of these statements as true for water, or true for most other substances.
Solid iron(lIl) oxide reacts with hydrogen gas to form solid iron and liquid water
Write the balanced chemical equation for the following reaction. Phases are optional. Solid iron(lIl) oxide reacts with hydrogen gas to form solid iron and liquid water
Explain interactions between the following phases: a)solid-liquid b)solid-gas c)gas-liquid d)liq.1-liq.2
Explain interactions between the following phases: a)solid-liquid b)solid-gas c)gas-liquid d)liq.1-liq.2
Write a 5-10 sentence conclusion describing the changes in temperature for a solid, liquid, and gas...
Write a 5-10 sentence conclusion describing the changes in temperature for a solid, liquid, and gas affect the amount of energy and types of motion that each phase has and the randomness of motion. Use some of the observations to justify your conclusion.  
ADVERTISEMENT
ADVERTISEMENT
ADVERTISEMENT