Answer:
#here is program in python
#read 4 digit number
date=int(input("enter the date:"))
#first 2 digit is day
day=int(date/100)
#last 2 digit is month
month=date%100
#find the week of the month
if day<=7:
week=1
elif day>=8 and day<=14:
week=2
elif day>=15 and day<=21:
week=3
elif day>=22 and day<=28:
week=4
elif day>=29:
week=5
#check for Winter
if month in [12,1,2]:
print("week {} of Winter.".format(week))
# check for Spring
elif month in [3,4,5]:
print("week {} of Spring.".format(week))
#check for Summer
elif month in [6,7,8]:
print("week {} of Summer.".format(week))
#check for Fall
elif month in [9,10,11]:
print("week {} of Fall.".format(week))
Explanation:
Read a 4 digit number from user.first 2 digits represents the day and last 2 month.Then find the week of the month.If the month is in [12,1,2] then it will print "Winter" and week of that month.If month is in [3,4,5] then print "Summer" with week.If the month is in [6,7,8] then "Summer" and if the month is in [9,10,11] then "Fall".
Output:
enter the date:1212
week 2 of Winter.