100 746
Assignments Done
98.1%
Successfully Done
In July 2021

Answer to Question #12164 in C# for Fiona

Question #12164
A program that will input Word in month from (2000 January to December) and their Numeric dates and output how many week it consume and display whether it is Monday, Tuesday, Wednesday, and etc. Relate the program below:

SAMPLE OUTPUT

Enter Word Month : January
Enter Numeric Date : 31

January 31,2001 is equivalent to 31 days.
It is equivalent to 4 weeks and 3 days.

January 31,2001 is Monday.

Enter Word Month : Jry
Enter Numeric Date : 31

INVALID ENTRY!

Enter Word Month : December
Enter Numeric Date : 33

INVALID ENTRY!

NOTE: Please include from each program the INVALIDATION For instance 'INVALID ENTRY'!.
1
2012-07-24T10:01:44-0400
class Program

{

private const int YEAR = 2000;

static void Main(string[] args)

{

Console.Write(&quot;Enter Word Month: &quot;);

Console.Write(&quot;Enter Numveric Date: &quot;);

DateTime dt;

//try parsing the combined input as a date

if (DateTime.TryParse(string.Format(&quot;{0} {1}, {2}&quot;, monthInput, dateInput, YEAR), out dt))

{

int days = DateTime.DaysInMonth(YEAR, dt.Month); // get days in the month

Console.WriteLine(&quot;{0:MMMM d,yyy} is equivalent to {1} days.&quot;, dt, days);

Console.WriteLine(&quot;It is equivalent to {0} weeks and {1} days.&quot;, days / 7, days % 7);

Console.WriteLine(&quot;{0:MMMM d,yyy} is {1}&quot;, dt, dt.DayOfWeek);

}

//if failed show &quot;invalid&quot; message

else

{

Console.WriteLine(&quot;INVALID ENTRY!&quot;);

}

}

}

Need a fast expert's response?

Submit order

and get a quick answer at the best price

for any assignment or question with DETAILED EXPLANATIONS!