Levels Tought:
Elementary,Middle School,High School,College,University,PHD
Teaching Since: | Apr 2017 |
Last Sign in: | 8 Weeks Ago, 4 Days Ago |
Questions Answered: | 4870 |
Tutorials Posted: | 4863 |
MBA IT, Mater in Science and Technology
Devry
Jul-1996 - Jul-2000
Professor
Devry University
Mar-2010 - Oct-2016
 am a beginning programmer. I am looking for an iteration loop so that I can continue to enter the month number and keep the program running. This is what I have so far in C# visual studio. if you run this it allows for one input and then shuts the program down. What am I missing?
       static void Main(string[] args)
       {
           //declare variables
Â
         int month = 0;
Â
Â
Â
           Console.Write("Enter the Number of the Month: ");
           month = Convert.ToInt32(Console.ReadLine());
Â
           if (month == 1)
           {
               Console.WriteLine("January is the first month of the Year");
           }
           else if (month == 2)
           {
               Console.WriteLine("February is the second month of the year");
           }
           else if (month == 3)
           {
               Console.WriteLine("March is the third month of the year");
           }
           else if (month == 4)
           {
               Console.WriteLine("April is the fourth month of the year");
           }
           else if (month == 5)
           {
               Console.WriteLine("May is the fifth month of the year");
           }
           else if (month == 6)
           {
               Console.WriteLine("June is the sixth month of the year");
           }
           else if (month == 7)
           {
               Console.WriteLine("July is the seventh month of the year");
           }
           else if (month == 8)
           {
               Console.WriteLine("August is the eighth month of the year");
           }
           else if (month == 9)
           {
               Console.WriteLine("September is the ninth month of the year");
           }
           else if (month == 10)
           {
               Console.WriteLine("October is the tenth month of the year");
           }
           else if (month == 11)
           {
               Console.WriteLine("November is the eleventh month of the year");
           }
           else if (month == 12)
           {
               Console.WriteLine("December is the twelfth month of the year MERRY CHRISTMAS");
           }
           Console.Write("Enter the Number of the Month: ");
           month = Convert.ToInt32(Console.ReadLine());
           {
Â
           }
Â
Â
Â
Â
Â
           {
               Console.ReadLine();
           }
Â
Â