In a calendar program, how to figure out which day a month ends on in order to start the next month on the right day?
Hi! I was wondering if someone could help me to figure out how to solve a problem in my code. It's the first semester I take C++ programming, so I'm still struggling with the design of the programs.
I need to write the C++ code for a calendar that only requires the user to enter the year and in which day the year starts (Sunday, Monday, etc). This code has to be able to handle leap years (by diving the year by 400, or by 4 or 100), and show the twelve months. This is the code I've written so far. It recognizes if the year is leap or odd, and prints me the twelve months in the desired way. However, I still can't figure out how to make the program able to recognize in which day a month ends in order to start the next month in the right day. I hope you can help me with that. Any hint will be highly appreciated.