Calendar Problems

Google Advertisements

Prev Tutorial Next Tutorial

Calendar Problems

Most of the students are having difficulties in solving the Calendar problems. Already many logic are there to solve these kinds of problems, but all these logics are difficult to understand. So here is the simple way to solve calendar problems.

calendar problems

Leap Year: A particular year divisible by 4 is called leap year, also it should not be century year. Example: 1976, 1840 are leap year as they are divisible by 4.

Each fourth century is a leap year. Example: 400, 800, 1200, 1600, 2000, 2400 are leap years, but 700, 1300, 1900 are not leap years.

Odd Days: For a given number of days, number of days more than complete week are called odd days. Example: in 10 days, there is one week and 3 odd days.

Counting of Weeks and Days in Year

  • 1 ordinary year has 365 days = 52 weeks + 1 odd day
  • 1 leap year has 366 days = 52 weeks + 2 odd days
  • 100 years = 76 ordinary years + 24 leap years = 76*1 + 24*2 = 124 odd days = 17 weeks + 5 odd days
  • Since in 100 years, number of odd days are 5
  • In 200 years, number of odd days are 5*2= 10 = 1 week + 3 odd days, 3 odd days
  • Similarly in 300 years 5*3 = 15 = 2 weeks + 1 odd day
  • Similarly for 400 years number of odd days 5*4 + 1 = 0 odd days, from this we conclude that for 800, 1200, 1600 , 2000, 2400 years odd days will be zero

Year Code

>
1600-16991700-17991800-18991900-19992000-2099
64206

Month Code

JanFebMarAprMayJuneJulyAugSepOctNovDec
033614625035

Day Code

SunMonTuesWedThrusFriSat
0123456

Steps to Solve Calender Problems

  • Add the day digit to last two digit of the year.
  • Divide the last two digits of the year by four.
  • Add the Quotient value in step 3 to result obtain in step 1.
  • Add Month Code and year codes to the result obtain in step3.
  • Divide the result of step4 by seven.
  • Obtain the remainder and match with the day code.
calendar problems

Odd Day Code

DaySunMonTuesWedThrusFriSat
Odd day no.0123456

What was the day of the week on 20 may, 1985 ?

Solution

 Here Number of odd days in 1600 years = 0 
 
Number of odd days in 300 years from 1600 to 
1900 = 5*3 = 2 week + 1 odd day= 1 odd day 
 
Number of odd days in 84 years= 21 leap year 
+ 63 days = 21*2 + 63*1 = 105 days = 0 odd days 
 
Number of odd days in 20 may = 31 days of Jan. + 28 days of feb + 31 
days of mar + 30 days in april + 20 days in may = 140 days = 0 odd day
 
So total number of odd days = 0+1+0+0=1 = Monday 

On what date of Feb. 2007 did Saturday fall ?

Solution

 For this find the day of 1.2.2007 
 
1600+400 years has 0 odd days 
 
From 2001 to 2006 there are 1 leap years + 5 ordinary years  
 
So number of odd days = 1*2 + 5*1 = 2 + 5 = 7 = 1 week = 0 odd day 
 
Now from 1.1.2007 to 1.2.2007 number of days = 32 = 4 weeks + 4 odd days = 4 odd days 
 
So, total number of odd days = 4, so 1.2.2007 will be thrusday 
 
Now saturday will be on 3.2.2007 

Today is tuesday. After 72 days, it will be ?

Solution

Tuesday will be repeated after each 7 days so, after at 70 day
 it will also be Tuesday, so at 72 th day it will be Friday

Prev Tutorial Next Tutorial

Google Advertisements

We have more than 5 Groups which have 500000+ Members and some Pages have more than 100000+ members. If you want to post your article on our website/FB Group/FB Page please contact on [email protected] or 8076671483

Buy This Ad Space @$50 per Month, Ad Size 600X200 Contact on: [email protected] or 8076671483

Path variable is set for providing path for all Java tools like java, javac, javap, javah, jar, appletviewer which are used in java programming. All these tools are available in bin folders so we set path upto bin folders.

Classpath variable is set for providing a path for predefined Java classes which is used in our application. All classes are available in lib/rt.jar so we set classpath upto lib/rt.jar.

Cloud computing is the on demand availability of computer system resources, especially data storage and computing power, without direct active management by the user.

College Projects Related to Java, AWT, C Projects for College, C++ Projects for College, Android Projects.

Download Projects

Adsense Advertisements


Buy This ads Space 8076671483

Buy This Ad Space @$120 per Month, Ad Size 300X600 Contact on: [email protected] or 8076671483 Try this Keyword C++ Programs