write a program in python to take 2 inputs for day, month and then calculate which day of the year, the given date is. for simplicity take 30 days a month.
Answers
Answered by
1
Sorry I can’t understand your question
Answered by
4
Answer: ill explain it in pseudo code
he is asking you for a julian date where it indicates what is the number of the given day in the 366 or 365 days , for example 6th of JAN is the 6th julian day of the year, 1st of February is 30+1 =31 julian day because 31 days of the year have elapsed. you need to use a switch case .
Explanation:
Algo main ()
[ write(" enter the month and day")
input (month.day)
switch(month){
case(1): day=day;break;
case(2):day=day+30;break;
case(3):day=day+60;break; note we took Feb as 30 beacuse it said so .
case(4):day=day+90;break;
we continue to do that till December which is 12
case(12):day=day+330;
end switch }
then you simply say write(" the number of this day is ",day);
Similar questions
English,
6 months ago
Math,
6 months ago
Political Science,
1 year ago
Math,
1 year ago
Geography,
1 year ago