Answered step by step
Verified Expert Solution
Question
1 Approved Answer
Write a function that takes a month, day, and year as inputs and returns the number of days that have passed since January 1, 780,
Write a function that takes a month, day, and year as inputs and returns the number of days that have passed since January 1, 780, the year al-Khwarizmi, the "father of algebra", was born (include the 1/1/780 date as day 1). This function should include a subroutine" to deal with all leap year calculations. The subroutine is a function that will take a year as an input and will return a 1 if that year is a leap year or a 0 if that year is not a leap year. - men en annen some comments As a check, the number of days between 1/1/780 and 6/21/2011 is 449,786. Function Reset E MATLAB Documentation function d = day count(day, month, year) %start counter at a 6 Xadd either 365 or 366 for each year from 780 to year-1 %call function leap (defined below) to determine leap years 11 Xadd either 28, 29, 30, or 31 days each month in current year from January to month-1 12 %call function leap (defined below) to determine leap years 16 Xadd days in current month end function yesno = leap (year) %set yesno to 1 if year is a leap year 22 %set yesno to @ if year is not a leap year 26 end Write a function that takes a month, day, and year as inputs and returns the number of days that have passed since January 1, 780, the year al-Khwarizmi, the "father of algebra", was born (include the 1/1/780 date as day 1). This function should include a subroutine" to deal with all leap year calculations. The subroutine is a function that will take a year as an input and will return a 1 if that year is a leap year or a 0 if that year is not a leap year. - men en annen some comments As a check, the number of days between 1/1/780 and 6/21/2011 is 449,786. Function Reset E MATLAB Documentation function d = day count(day, month, year) %start counter at a 6 Xadd either 365 or 366 for each year from 780 to year-1 %call function leap (defined below) to determine leap years 11 Xadd either 28, 29, 30, or 31 days each month in current year from January to month-1 12 %call function leap (defined below) to determine leap years 16 Xadd days in current month end function yesno = leap (year) %set yesno to 1 if year is a leap year 22 %set yesno to @ if year is not a leap year 26 end
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