I really appreciated your replys, it helps me a lot when i can see how it is done they way you did it.It really helped me with my other ones I was working out. Do you know how to write a program to print out the calendar for a whole year by reading the year from the user and then using this formula i have to find the what the first day of the year lands on. It also needs to calculate leap years as well.

and the calendar program can only be done with the knowledge of loops, if/else switches etc.. NO RECURSIVE

If you have a new question please create a new thread. If your current thread has been solved please mark it as solved too.


Why can't you try something first yourself? Aren't you ashamed to ask others to do your work for you?

I have been trying to get this for the past week all i can figure out is how to get it to print out to find one month.

So, what is the difficulty in printing 12 months? For the time being post the code that prints one month.

I have been trying to get this for the past week all i can figure out is how to get it to print out to find one month.

You need to plan out how the program is going to work before you even start writing it. I'll give you some hints:

  • You need to know when the leap years are. This won't be too difficult, because you just need one year you know is a leap year, and then you can calculate when all the rest are.
  • Except for leap years, all years have 365 days. You can use it to calculate when the next year will take place, etc..
  • To figure out which day the first day of the year is, find a spot you already know (for example, 2006). Then you can calculate when others years start, because you know the length of a year.
  • Once you've figured out when the year starts, the rest is easy. You know how many days are in each month, so simply throw in the numbers, and you're done!

Hope this helps

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.