Question: Task 6 (20 pts.) The program task6.java given below is an incomplete program that takes as input from the user a year and a month,








Task 6 (20 pts.) The program task6.java given below is an incomplete program that takes as input from the user a year and a month, and prints: whether the year is a leap year or not, the number of days in that year, and the number of days in that specific month of the year. Complete that program, by defining three functions. The first function is called is_leap_year, and should satisfy the following specs: is-leap-year takes one argument, called year, which is an integer greater than 0 (we will only test your code with such values) If year is a leap year, then the function returns boolean value true. Otherwise, year_days (year) returns false. The second function is called year_days, and should satisfy the following specs: year_ days takes one argument, called year, which is an integer greater than 0 (we will only test your code with such values) If year is a leap year, then year_days (year) returns 366. Otherwise, year_days (year) returns 365 The third function is called month_days, and should satisfy the following specs: month_days takes two arguments, called year, month. Argument year is an integer greater than 0 (we will only test your code with such values). The month argument is an integer between 1 and 12 (we will only test your code with such values). The function returns the number of days that the month lasts for. Unless the month is 2 (for February), the result does not depend on the year. If the month is 2, then obviously the result
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
