Answered step by step
Verified Expert Solution
Question
1 Approved Answer
For month 4, 6, 9, 11, return 30. For month 2, if it is leap year, return 29, otherwise return 28. A year is a
For month 4, 6, 9, 11, return 30. For month 2, if it is leap year, return 29, otherwise return 28. A year is a leap year if the year number is a multiple of 4 but not a multiple of 100. However, if a year number is a multiple of 400, the year is a leap year. The following are some sample runs: > run Days OfAMonth > run Days OfAMonth Enter the year: 2000 Enter the year: 2001 Enter the month: 6 Enter the month: 12 6/2000 has 30 days. 12/2001 has 31 days. > run Days OfAMonth Enter the year: 1997 Enter the month: 7 2/1997 has 28 days. > run DaysOfAMonth Enter the year: 2016 Enter the month: 2 2/2016 has 29 days. > run Days OfAMonth Enter the year: 1990 Enter the month: 2 2/1990 has 28 days. > run Days OfAMonth Enter the year: 2000 Enter the month: 2 2/2000 has 29 days. Full Screen v Grading 6 DaysOfAMonth.Java New 1- import java.util.Scanner;||
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