Menu

[Solved]Q4 Examine Following Rules Determine Whether Year Leap Year Year Divides Evenly 4 S Normal Q37019366

Hello,

Please assist me with this question in html and javascriptlanguage. Thank you.

Q.4. Examine the following rules to determine whether a year is a leap year: If the year divides evenly by 4, its normally a

Q.4. Examine the following rules to determine whether a year is a leap year: If the year divides evenly by 4, it’s normally a leap year However, if it also divides evenly by 100, but not by 400, it actually isn’t a leap year a) Using Javascript, write a function called is_leap which receives as an argument a year number, and which implements the rules provided above, in order to return a True value if the year is a leap year, or a False value otherwise [51 b) Write a Javascript function no of_days(month, year) which receives as arguments a month number (in the range 1-12) and a year number. The function should return the number of days in the given month in the given year (see table below). This function should make use of your is_leap function in the case where the month is February. (February has 29 days in a leap year but otherwise has 28 days) Assume you have been provided with an array of valid English words (containing perhaps 40000 strings). Assume also that the array is in alphabetically sorted order c) Write a function which receives a word (as a string argument) and returns True if the word is in the array of valid English words, or returns False otherwise d) Ideally, the function should use an efficient searching algori MONTH JANUARY FEBRUARY MARCEH APRIL MAY JUNE JULY AUGUST SEPTEMBER OCTOBER NOVEMBER DECEMBER NUMBER OF DAYS 31 28 or 29 30 30 31 30 30 31 Show transcribed image text Q.4. Examine the following rules to determine whether a year is a leap year: If the year divides evenly by 4, it’s normally a leap year However, if it also divides evenly by 100, but not by 400, it actually isn’t a leap year a) Using Javascript, write a function called is_leap which receives as an argument a year number, and which implements the rules provided above, in order to return a True value if the year is a leap year, or a False value otherwise [51 b) Write a Javascript function no of_days(month, year) which receives as arguments a month number (in the range 1-12) and a year number. The function should return the number of days in the given month in the given year (see table below). This function should make use of your is_leap function in the case where the month is February. (February has 29 days in a leap year but otherwise has 28 days) Assume you have been provided with an array of valid English words (containing perhaps 40000 strings). Assume also that the array is in alphabetically sorted order c) Write a function which receives a word (as a string argument) and returns True if the word is in the array of valid English words, or returns False otherwise d) Ideally, the function should use an efficient searching algori MONTH JANUARY FEBRUARY MARCEH APRIL MAY JUNE JULY AUGUST SEPTEMBER OCTOBER NOVEMBER DECEMBER NUMBER OF DAYS 31 28 or 29 30 30 31 30 30 31

Expert Answer


Answer to Q.4. Examine the following rules to determine whether a year is a leap year: If the year divides evenly by 4, it’s norma… . . .

OR


Leave a Reply

Your email address will not be published. Required fields are marked *