What is the current state of water?
In physics, a state of matter is one of the distinct forms in which matter can exist. Four states of matter are observable in everyday life: solid, liquid, gas, and plasma. Many intermediate states are known to exist, such as liquid crystal, and some states only exist under extreme conditions, such as Bose–Einstein condensates (in extreme cold), neutron-degenerate matter (in extreme density), and quark–gluon plasma (at extremely high energy).
Write a program that outputs liquid state, solid state or gaseous state depending on the temperature of water in °C.
Use this boilerplate code as a starting point:
Remember to add a comment before a subprogram or selection statement to explain its purpose.
Enter the temperature in °C: 20
The water is in a liquid state.
Enter the temperature in °C: -8
The water is in a solid state.
Enter the temperature in °C: 106.89
The water is in a gaseous state.
Use these resources as a reference to help you meet the success criteria.
Run the unit tests below to check that your program has met the success criteria.
Enter the temperature in °C: -12.5
The water is in a solid state.
Enter the temperature in °C: 7
The water is in a liquid state.
Enter the temperature in °C: 160.459
The water is in a gaseous state.
Check that you have: