This is what I have of my code so far but I cant get it to work right, Can someone help me fix this
I need to make a float function that converts celsius to fahrenheit but im not totally sure how to do it
I also need to make a function based on what the fahrenheit temp is and make it return the state water would be in at that temp
thanks
-Mason
#include <iostream>
#include <string>
using namespace std;
float cel_to_far (float celsius);
string state_of_water (float fahrenheit);
float celsius;
float fahrenheit;
int main ()
{
cout << "Enter the degrees of water in in celsius. ";
cin >> celsius;
cout << endl;
cout << "When you have " << celsius << " degrees celsius, that is equal to " << cel_to_far << " degrees fahrenheit" << endl;
cout << endl;
cout << state_of_water << endl;
return 0;
}
float cel_to_far (float celsius)
{
fahrenheit = celsius * 9 / 5 + 32;
return fahrenheit;
}
string state_of_water (float fahrenheit)
{
if (fahrenheit <= 32)
return "Solid (ice)";
if (fahrenheit >= 33 && fahrenheit <= 211)
return "Liquid (water)";
else
return "Gas (steam)";
}