usingSystem;
usingSystem.Collections.Generic;
usingSystem.Linq;
usingSystem.Text;
namespaceConsoleApplication14
{
class Temp
{
public double Fahrenheit(doubleC)
{
doubleF;
F = (9 * C / 5) + 32;
Console.WriteLine("Corresponding temperature in degrees Fahrenheit :"+Math.Round(F,2));
return F;
}
}
class Program
{
static void Main()
{
ConsoleKeyInfok;
do
{
Tempd = new Temp();
doubleC;
Console.Write("enter a temperature in degrees Celsius ");
C = double.Parse(Console.ReadLine());
if(C < -999)
{
Console.Write("Please,enter a temperature in degrees Celsius more then -999 : ");
C = double.Parse(Console.ReadLine());
d.Fahrenheit(C);
}
elsed.Fahrenheit(C);
Console.WriteLine("...Press ESC to exit...");
k = Console.ReadKey(true);
Console.Clear();
}
while(k.Key != ConsoleKey.Escape);
Console.ReadLine();
}
}
}
Comments
Leave a comment