using System;
namespace Temperature
{
class TempChecker
{
public static void Main(string[] args)
{
while (true)
{
[Link]("Enter the temperature (or type 'exit' to quit):
"); string? inputTemperature = [Link]();
if (inputTemperature?.ToLower() == "exit")
{
break;
}
if ([Link](inputTemperature))
{
[Link]("Invalid input. Please enter a valid
temperature."); continue;
}
if ()
{
[Link]("Invalid input. Please enter a valid numeric
temperature."); continue;
}
[Link]("Choose a conversion:");
[Link]("1. Celsius to Fahrenheit");
[Link]("2. Fahrenheit to Celsius");
string? inputChoice = [Link]();
if ([Link](inputChoice) || )
{
[Link]("Invalid choice. Please enter a valid
option."); continue;
}
double convertedTemperature;
if (choice == 1)
{
convertedTemperature = (temperature * 9 / 5) + 32;
[Link]($"{temperature} degrees Celsius is
{convertedTemperature} degrees Fahrenheit.");
}
else if (choice == 2)
{
convertedTemperature = (temperature - 32) * 5 / 9;
[Link]($"{temperature} degrees Fahrenheit is
{convertedTemperature} degrees Celsius.");
}
else
{
[Link]("Invalid Choice. Try again.");
}
[Link]();
}
[Link]("Goodbye!");
}
}
}