|
Any ideas of how I can have a calendar for all 12 months print for any year?
The user inputs the year and the day of the week for January 1st of that year. (Sunday = 0, Monday = 1, etc.)
The user inputs the year and the day of the week for January 1st of that year. (Sunday = 0, Monday = 1, etc.)
![Calendar Calendar](/uploads/1/2/6/1/126182146/812828607.png)
Important:
I cannot use cases. (That's what I've mostly seen online to solve this problem)
I can only use <iostream>, no other libraries.
And I am supposed to use two for loops.
I cannot use cases. (That's what I've mostly seen online to solve this problem)
I can only use <iostream>, no other libraries.
And I am supposed to use two for loops.
Dev C Calendar Template
Get notifications on updates for this project. Get the SourceForge newsletter. Get newsletters and notices that include site news, special offers and exclusive discounts about IT products & services.
- Select the arrow on each calendar to overlay them and see when everyone's available. Select Today to go back to the current day. Get quick access to your calendar. Hover over Calendar to see a quick view of your calendar and scheduled events for the day. Introduction to the Outlook Calendar. Discover more Outlook training at LinkedIn.
- I'm trying to write a program that outputs a calendar. The user has to input the day in which the month starts (Monday-0, Tuesday-1, etc.), and how many days are in the month. Depending on what day the month starts, the calendar dates will start under that specific day.
Could someone provide a pseudocode or any suggestions?
- 4 Contributors
- forum 10 Replies
- 12,418 Views
- 2 Years Discussion Span
- commentLatest Postby 0igoLatest Post
deceptikon1,790
Dav Calendar 2018
Well, you know how many days are in each month, and what weekday the year starts, so the algorithm stands out immediately as a couple of nested loops with a few counters that wrap around at appropriate times. You're looking at around 10 lines of code.
Dev C++ 5.11
Don't over complicate things, this is almost a no brainer. Of course handling leap years and error handling the weekday input are both minor complications, but it's not a big deal. See if you can come up with an algorithm on your own.
Dev C Calendar 2018
Edited by deceptikon