//Ava Huntington CS1A Chapter 4 Homework P. 224, #20
//
/*******************************************************************************
* DETERMINING FREEZING/BOILING SUBSTANCES
* _____________________________________________________________________________
* This program will determine wether Ethyl Alchohol, Mercury, Oxygen, and Water
* will boil or freeze at a given temperature in Farenheit using this data:
*
* |Substance| |Freezing point (F)| |Boiling point (F)|
* Ethyl Alchohol -173 172
* Mercury -38 676
* Oxygen -362 -306
* Water 32 212
* _____________________________________________________________________________
* INPUT
* givenTemp: Temperature given
*
* OUTPUT
* frozenSubstance: Specified substance will freeze at given temperature
* boilingSubstance: Specified substance will boil at given temperature
******************************************************************************/
#include <iostream>
using namespace std;
int main()
{
float givenTemp; //INPUT: Temperature given
//Prompt to get temperature input
cout << "Please enter a temperature in farenheit and I will tell you wether"
" the substances Ethyl Alchohol, Mercury, Oxygen, and Water will freeze or"
" boil at the given temperature"<<endl;
cin >> givenTemp;
//Display given temperature
cout << "You entered " << givenTemp << " degrees farenheit." << endl;
//CHECK FOR FREEZING
if (givenTemp<=-173)
cout << "Ethyl Alchohol will freeze at this temperature."<< endl;
if (givenTemp<=-38)
cout << "Mercury will freeze at this temperature." << endl;
if (givenTemp<=-362)
cout << "Oxygen will freeze at this temperature." << endl;
if (givenTemp<=32)
cout << "Water will freeze at this temperature." << endl;
else if (givenTemp>32)
cout << "None of the substances will freeze at this temperature."<< endl;
//CHECK FOR BOILING
if (givenTemp>=172)
cout << "Ethyl Alchohol will boil at this temperature." << endl;
if (givenTemp>=676)
cout << "Mercury will boil at this temperature." << endl;
if (givenTemp>=-306)
cout << "Oxygen will boil at this temperature." << endl;
if (givenTemp>=212)
cout << "Water will boil at this temperature." << endl;
else if (givenTemp<-306)
cout << "None of the substances will boil at this temperature." << endl;
return 0;
}