Question: Create an enumeration named Month that holds values for the months of the year. With JANUARY equal to 1, FEBRUARY equal to 2, and so

Create an enumeration named Month that holds values for the months of the year. With JANUARY equal to 1, FEBRUARY equal to 2, and so on through DECEMBER equal to 12.

Write a program named MonthNames that prompts the user for a month integer. Convert the users entry to a Month value, and display it.

Make sure your integer prompt message does not contain any month names (January, etc.) as this will cause the tests to fail! For Example: "Enter a month number >> " does not contain month names and will work properly.Create an enumeration named Month that holds values for the months of

Tasks MonthNames.cs + >_ Terminal + enum Month created 0.00 out of 10.00 Co 0 out of 1 checks passed. Review the results below for more details. Checks Code Pattern Incomplete enum Month created Description Searched your code for a specific pattern: 1 using System; 2 using static System.Console; 3 class MonthNames 4 enum month 5 { 6 { 7 January = 1, 8 February 9 March, 10 April, 11 May, 12 June, 13 July, 14 August, 15 September, 16 October, 17 November, 18 December 19 }; 20 { 21 WriteLine("Enter a month number: "); 22. string val; 23 val = ReadLine(); 24 int m; 25 m = Convert.ToInt32 (val); 26 WriteLine(Enum. GetName(typeof (month), m-1)); 27 } 28 } 29 enum\s*Months*{ You can learn more about regular expressions here. Correct month name output 6

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!