Calendar Problems – Programmerbay https://programmerbay.com A Tech Bay for Tech Savvy Sat, 22 Jul 2023 09:37:16 +0000 en-US hourly 1 https://wordpress.org/?v=6.5.5 https://programmerbay.com/wp-content/uploads/2019/09/cropped-without-transparent-32x32.jpg Calendar Problems – Programmerbay https://programmerbay.com 32 32 Calendar Problems Tricks And Shortcuts With Examples https://programmerbay.com/calendar-problems-tricks-and-shortcuts-with-examples/ https://programmerbay.com/calendar-problems-tricks-and-shortcuts-with-examples/#respond Tue, 11 Jul 2023 11:30:50 +0000 https://www.programmerbay.com/?p=4230 In this article, we will be aiming at various calendar problem’s tricks and concepts which is going to save your time while solving these types of questions.

Calendar Problem Concepts

First, let’s brush up basic concepts to which we already familiar with:

  • 1 week = 7 days
  • 1 year = 365 days or 366 days

A normal year has 365 days, consisting of 52 weeks and one extra day. On the other hand, a leap year has 366 days, consisting of 52 weeks and two extra days. A leap year always repeat after 4 years.

  • Normal year = 365 days = 52 weeks and 2 extra days
  • Leap year = 366 days = 52 weeks and 1 extra day (one extra days Occurs in the February Month = 29 days)

To check Whether a year is a leap year or not?

A year that consists of 366 days is known as a leap year. It is easy to know which year is a leap year. Let’s have a look:-

  1. If the given year is divisible by 4 and not divisible by 100 then it is a leap year. If the given year is divisible by 100 then we need to follow the second step to check whether it is a leap year or not.
    • For example, 2016 is a leap year, since it is divisible by 4 but not 100. however, for the year 2000, we find that it divisible by 4 but also by 100 too, in such cases we can’t say it is a leap year or not, for this we have to follow 2nd step.
  2. If the given year is divisible by 100, then it should also be divisible by 400 in order to be qualified as a leap year.
    • Since 2000 is also divisible by 400, it is a leap year.

Now lets come to the Calendar tricks you should know:

Week codes

CenturyCode
16006
17004
18002
19000
20006
21004
22002
23000

Month codes

  • For Normal years
MonthCode
January0
February3
March3
March6
May1
June 4
July 6
August 2
September 5
October 0
November 3
December5
  • For Leap years
MonthCode
January6
February2
March3
March6
May1
June 4
July 6
August 2
September 5
October 0
November 3
December5

Century codes

CenturyCode
16006
17004
18002
19000
20006
21004
22002
23000

Types Questions Asked from Calendar Problem

  • Directly Asking what day will be on a particular date

Case 1: For Normal or ordinary Year

These are the steps to solve:
1) Pick up last two digits from the given year
2) Divide it by 4 and take its quotient
3) Use date that is already given in the question
4) Use month code of the given month specified in the question
5) Use century code
6) Add altogether from 1 to all the way 5th step
7) Divide the sum by 7 and find its remainder
8) A reminder would represent the week code
Q. What was the day of the week on 11th, July 2019?
So,
The date is 11th, July 2019
Step 1. Take the last two digits from the given the year 2019 = 19
Step 2. Divide it by 4:
19 / 4 = Quotient = 11, Remainder 3
Step 3. Given date = 11
Step 4. Given Month = July and its month code is = 6
Step 5. Century Code 2000’s is = 6
Step 6. Total sum = 19+11+11+6+6 =53
Step 7. Divide it by 7
53/7 = Quotient = 7, Remainder = 4
Step 8. Week code 4 represents Thursday
So, Thursday is the answer.

Case 2: For Leap Year

1) Follow all 7 Steps as mentioned in an ordinary year and must follow week table of Leap year mentioned above.
Q. What was the day of the week on 26th, January 2016?
So,
The date is 26th, January 2016
Step 1. Take the last two digits from the given the year 2016 = 16
Step 2. Divide it by 4:
16 / 4 = Quotient = 4, Remainder 0
Step 3. Given date = 26
Step 4. Given Month = January and its month code is = 6
Step 5. Century Code for 2000’s is = 6
Step 6. Total sum = 16+4+26+6 +6=58
Step 7. Divide it by 7
58/7 = Quotient = 8, Remainder = 2
Step 8. Week code 1 represents Tuesday
So, Tuesday is the answer.
  • Directly Asking which day will be after the given number of days from the mentioned day

Step to solve it:

Step 1. Divide the given number of days by 7 and find the remainder

Step 2. Add the given remainder to corresponding week code, and the resultant code will be our answer

 

Q. If today is Thursday then after 15 days, the day will be?

Step 1. 15/7 = Quotient 2, Remainder 1

Step 2. Thursday = 4, 4+1 = 5 , refers to Friday

  • Can ask which would be the very first mentioned day in a given month of a year

Need to perform a basic addition operation

 

Q. When will be the first Friday fall in the month of July 2019?

On 1st July 2019, the day will be Monday by using the method mentioned in the above example. On 5th July will be first Friday

  • In this, date along with day will be given and using that day as a base, you need to figure out what will be the day for the asked date

    Just find an extra or odd day in between the years and add extra days only if February of that month covers. In a leap year, there are 2 extra days and in Normal year there is only one odd day

 

Q If 26th May 2018 falls Saturday then What day will be on 26th May 2019

Between this, Only a single February falls which is in the year 2019. So we add only odd days of 2019, skipping 2018

Day on 26th May 2018 = Saturday = 6

Odd days in the year 2019 is = 1

6+1= 7

So, 26th May 2019 falls on Sunday.

Below are some practise question for Calendar Problem:

Question. What would be the day on 25th January 1950?
Answer Wednesday

Question. If the day on 4th October 2018 was Thursday, then what will be the day on 2nd February 2019?
Answer Saturday

Question. What will be the day on 20th May 2030?

Answer Monday

Question. When will be the first Sunday fall in the month of July 2024?

Answer 6th July 2024

]]>
https://programmerbay.com/calendar-problems-tricks-and-shortcuts-with-examples/feed/ 0