Ok so after modeling after another application Im modifying a previous console app which converts Celsius
temp (with user input) to Fahrenheit. Visual Studio has annoying habits to give errors on variables that "haven't been declared yet". Im looking at this and wondering why the heck is it complaining. I have the identifier's all correct and took into account the syntax errors that could be done.
i think for the first line "const float" Im wondering whether to just place "Celsius * 9/5 +32 " instead of just "c" since it doesn't like that.
const float CELSIUS_TO_FAHRENHEIT = * 9/5 + 32;
double celsius;
DisplayInstructions();
celsiusTemp = GetCelsiusTemp();
celsius = CalculateCelsius(celsiusTemp, CELSIUS_TO_FAHRENHEIT);
}
public static void DisplayInstructions()
{
Console.WriteLine("Welcome to the Celsius to Fahrenheit Converter!");
}
public static double GetCelsiusTemp()
{
string inValue;
int celsius;
Console.WriteLine("\n\nPlease Enter the Celsius value you wish to convert");
inValue = Console.ReadLine();
celsius = int.Parse(inValue);
return celsius;
}
public static int CalculateCelsius(int celsius, int CELSIUS_TO_FAHRENHEIT)
{
return celsius * (9/5 + 32);
}
public static void DisplayResults(int celsius)
{
Console.Clear();
Console.WriteLine("Temperture in Fahrenheit");
Console.WriteLine("------------------------");
Console.Read();
}
Thanks for the help