A Sample Solution:
What day of the week is your birthday if your birthday is February 6, 1997?
First you will find out how many days old you are on a certain day. For this example, we'll say today is Friday March 2, 2018.
You would be 21 years old, so you will multiply 21 years x 365 days to get 7665 days. Then add a day for every February 29th that you have been alive for. There is a February 29th every four years, on years that are divisible by 4. In this case, you have been alive for 5 February 29ths. Add this to your previous total to find out how many days old you were on your last birthday (7665+5=7670 days).
Now add in the number of days since your last birthday. From February 6th to March 2nd, 24 days have passed because it is not a leap year. 7670+24=7694 days old on that date.
7694mod(7) is equivalent to 1. Since "today's date" is a Friday, Friday=0, Thursday=1, Wednesday=2, Tuesday=3, Monday=4, Sunday=5, and Saturday=6. If your birthday is February 6, 1997, you were born on a Thursday!
First you will find out how many days old you are on a certain day. For this example, we'll say today is Friday March 2, 2018.
You would be 21 years old, so you will multiply 21 years x 365 days to get 7665 days. Then add a day for every February 29th that you have been alive for. There is a February 29th every four years, on years that are divisible by 4. In this case, you have been alive for 5 February 29ths. Add this to your previous total to find out how many days old you were on your last birthday (7665+5=7670 days).
Now add in the number of days since your last birthday. From February 6th to March 2nd, 24 days have passed because it is not a leap year. 7670+24=7694 days old on that date.
7694mod(7) is equivalent to 1. Since "today's date" is a Friday, Friday=0, Thursday=1, Wednesday=2, Tuesday=3, Monday=4, Sunday=5, and Saturday=6. If your birthday is February 6, 1997, you were born on a Thursday!