This is what I have already but I dont know if I am meeting the specs for my assingment... anyone have any input of what I should do?
Assignment is Write a program that will ask the user for a temperature in Centigrade (Celsius) and convert it to the Fahrenheit scale. Then it will classify the temperature as either "steam", "water" or "ice". You will have to research the temperatures where water changes from one state to another. You will have to find the equation that converts from one scale to the other. State your references in a comment in your program file.
Write the temperature scale (C to F) conversion as a float function with one parameter. The function should not do any input from the keyboard nor output to the screen.
The classification should be done in another function which will return a string value. It should have one parameter. It should be written with as few comparisons as possible.
The main function will act as a driver, getting the input from the user and then calling the functions and reporting the results of the function calls.
my Program that Ihave so far is
#include <iostream>
#include <string>
using namespace std;
void cel_to_far (int celsius, int fahrenheit);
string state_of_water (int fahrenheit);
int celsius;
int fahrenheit;
int main ()
{
cout << "Enter the degrees of water in in celsius. ";
cin >> celsius;
cout << endl;
cout << "When you have " << celsius << " degrees, that is equal to " << cel_to_far << " degrees, Fahrenheit" << endl;
cout << endl;
cout << state_of_water << endl;
return 0;
}
void cel_to_far (int celsius, int fahrenheit)
{
fahrenheit = celsius * 9 / 5 + 32;
}
string state_of_water (int fahrenheit)
{
if (fahrenheit <= 32)
return "Solid (ice)";
if (fahrenheit >= 33 && fahrenheit <= 211)
return "Liquid (water)";
else
return "Gas (steam)";
}