Answered step by step
Verified Expert Solution
Question
1 Approved Answer
Marie invented a Time Machine and wants to test it by time - traveling to visit Russia on the Day of the Programmer ( the
Marie invented a Time Machine and wants to test it by timetraveling to visit Russia on the Day of the
Programmer the th day of the year during a year in the inclusive range from to
From to Russia's official calendar was the Julian calendar; since they used the
Gregorian calendar system. The transition from the Julian to Gregorian calendar system occurred in
when the next day after January st was February th This means that in February th
was the nd day of the year in Russia.
In both calendar systems, February is the only month with a variable amount of days; it has days
during a leap year, and days during all other years. In the Julian calendar, leap years are divisible by
; in the Gregorian calendar, leap years are either of the following:
Divisible by
Divisible by and not divisible by
Given a year, find the date of the th day of that year according to the official Russian calendar
during that year. Then print it in the format ddmmyyyy where dd is the twodigit day, mm is the two
digit month, and yyyy is
For example, the given year is divisible by so it is a leap year. The th day of a leap
year after is September so the answer is
Function Description
Complete the dayOfProgrammer function in the editor below. It should return a string representing the
date of the th day of the year given.
dayOfProgrammer has the following parameters:
year: an integer Input Format
A single integer denoting year
Constraints
le y le
Output Format
Print the full date of Day of the Programmer during year in the format ddmmyyyy where dd is the
twodigit day, mm is the twodigit month, and yyyy is
Explanation
In the year January has days, February has days, March has days, April has days,
May has days, June has days, July has days, and August has days. When we sum the total
number of days in the first eight months, we get Day of the
Programmer is the th day, so then calculate to determine that it falls on day of the
th month September We then print the full date in the specified format, which is Explanation
Year is a leap year, so February has days but all the other months have the same number of
days as in When we sum the total number of days in the first eight months, we get
Day of the Programmer is the th day, so then calculate to
determine that it falls on day of the th month September We then print the full date in the
specified format, which is
Explanation
Since is leap year as per Julian calendar. Day lies on September.
Solve the problem in python programming language and show all steps and formula
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started