// Elaine Torrez Chapter 4 P. 224, #20
/**************************************************************************
* FREEZING AND BOILING POINTS
* ------------------------------------------------------------------------
* This program asks the user to enter a temperature in Fahrenheit.
* It then displays which substances will freeze and which will boil
* at that temperature. The substances checked are:
* Ethyl alcohol, Mercury, Oxygen, and Water.
* ------------------------------------------------------------------------
* INPUT
* temperature : The temperature entered by the user (°F)
*
* OUTPUT
* Statements indicating whether each substance will freeze or boil
* at the entered temperature.
**************************************************************************/
#include <iostream>
using namespace std;
int main()
{
double temperature; // User input temperature in Fahrenheit
// Prompt user for input
cout << "Enter a temperature in Fahrenheit: ";
cin >> temperature;
// Check Ethyl alcohol
if (temperature <= -173)
cout << "Ethyl alcohol will freeze.\n";
if (temperature >= 172)
cout << "Ethyl alcohol will boil.\n";
// Check Mercury
if (temperature <= -38)
cout << "Mercury will freeze.\n";
if (temperature >= 676)
cout << "Mercury will boil.\n";
// Check Oxygen
if (temperature <= -362)
cout << "Oxygen will freeze.\n";
if (temperature >= -306)
cout << "Oxygen will boil.\n";
// Check Water
if (temperature <= 32)
cout << "Water will freeze.\n";
if (temperature >= 212)
cout << "Water will boil.\n";
return 0;
}