Answered step by step
Verified Expert Solution
Link Copied!

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,

image text in transcribed

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

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Expert Oracle Database Architecture

Authors: Thomas Kyte, Darl Kuhn

3rd Edition

1430262990, 9781430262992

More Books

Students also viewed these Databases questions

Question

How much loyalty does this public have for your organization?

Answered: 1 week ago

Question

Explain Coulomb's law with an example

Answered: 1 week ago

Question

What is operating system?

Answered: 1 week ago

Question

What is Ohm's law and also tell about Snell's law?

Answered: 1 week ago

Question

3 How supply and demand together determine market equilibrium.

Answered: 1 week ago