Console application crashing/not responding
<p>stack overflow community.</p>

<p>I am writing a program that convert fahrenheit temperature into celsius and celsius into fahrenheit. The program has a simple menu and gets the user input to select an option. I implemented a little do-while loop in case that the user enters an invalid option. If the user selects 1, 2, or 3 (which are the three valid options) the program will run an if statement, execute the block code within it, and break the loop. However, if the user enters anything else (an invalid option) the program will execute the block code in else and then it will go back to the beginning of the loop (Choose an option) freezing or crashing in the process.</p>

<p>Here is the code:</p>

<pre><code>// James Archbold
// Convert.cs
// A program to convert fahrenheit to celsius or celsius to fahrenheit
//16 February 2013

using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace Convert_Temperature
{
class Convert
{
    static void Main(string[] args)
    {
        float F, C;
        string option;

        do
        {
            Console.WriteLine("\nWelcome to 'Convert' program!");
            Console.WriteLine("***********************Menu**********************************");
            Console.WriteLine("1. Fahrenheit to Celsius");
            Console.WriteLine("2. Celsius to Fahrenheit");
            Console.WriteLine("3. Goodbye");

            Console.Write("\nPlease enter an option: ");
            option = Console.ReadLine();

            switch (option)
            {
                case "1":
                    Console.Write("Please enter your Fahrenheit temperature: ");
                    F = int.Parse(Console.ReadLine());
                    C = (5f / 9f) * (F - 32);
                    Console.WriteLine("The temperature is {0} degrees Celsius.", C);
                    Console.ReadKey();
                    break;


                case "2":
                    Console.Write("Please enter your Celsius temperature: ");
                    C = int.Parse(Console.ReadLine());

                    F = 5f / 9f * C - 32;

                    Console.WriteLine("The temperature is {0} degrees Fahrenheit.", F);

                    Console.ReadKey();
                    break;


                case "3":
                    Console.WriteLine("Goodbye!");
                    Console.ReadKey();
                    break;


                default:
                    Console.WriteLine("That is not a valid option!");
                    break;
            }

            Console.WriteLine("Please press Enter to continue...");
            Console.ReadLine();
            Console.WriteLine();

        } while (option != "3");

    }

}
</code></pre>

<p>}</p>
