If you already studied how to convert strings to numbers and how to perform basic operations with DateTime, then try this approach:
- Build a DateTime using provided month and year, specifying 1 for day. (See constructors of DateTime).
- Use AddMonths(1), which will move to the first day of the next month.
- Use AddDays(-1), which will give the last day of the month.
Do you need additional assistance?