subject

In this Java programming assignment, you will practice using selection statements to determine whether a given year in the past or future qualifies as a "Leap Year". I. Design a class called LeapYear in a file called LeapYear. java. This class will hold the main method and the class method that we will write in this assignment.
II. Write an empty public static void main(String[] args) method. This method should appear inside the curly braces of the LeapYear class.
III. Write one static class method (isLeapYear). The method isLeapYear should take one integer argument and will return a boolean. The method should compare the input (a year) with the qualifications for determining whether a given year is a leap year or not, and return the appropriate true or false value on completing these checks. The rule for leap years is as follows: if the year is evenly divisible by 4, it is a leap year, except in the case where it is also evenly divisible by 100 but not evenly divisible by 400. Several example method calls appear below.
LeapYear. isLeapYear(2016) // returns true, divisible evenly by 4
LeapYear. isLeapYear(2015) // returns false, not divisible evenly by 4
LeapYear. isLeapYear(1900) // returns false,
LeapYear. isLeapYear(2000) // returns true, divisible evenly by 4 and 100, but also by 400
IV. Complete the definition for main. Your program should create a new Scanner object, prompt the user to type in a year, and then collect an integer. The main method should then call the static method isLeapYear in order to determine whether or not the year in question fits the characteristics of a leap year. From this point, the results of the method call should be used to print a statement that expresses the results. For example, if the user enters 2015 as input: "The year 2015 is not a leap year."

ansver
Answers: 1

Another question on Computers and Technology

question
Computers and Technology, 22.06.2019 03:20
Which of these is a benefit of social networking? oa. hiding your true identity from friendsob. avoiding talking to people in personoc. spending time with friends instead of studyingod. connecting with new people
Answers: 2
question
Computers and Technology, 22.06.2019 17:00
The two main ways in which marketers address the competition with their strategies are by satisfying a need better than a competition and by
Answers: 2
question
Computers and Technology, 23.06.2019 03:10
Acomputer has a two-level cache. suppose that 60% of the memory references hit on the first level cache, 35% hit on the second level, and 5% miss. the access times are 5 nsec, 15 nsec, and 60 nsec, respectively, where the times for the level 2 cache and memory start counting at the moment it is known that they are needed (e.g., a level 2 cache access does not even start until the level 1 cache miss occurs). what is the average access time?
Answers: 1
question
Computers and Technology, 23.06.2019 15:00
Visually impaired individuals generally rely on the for navigation. thus, designers need to ensure that mouse-specific inputs, such as pointing, clicking, and hovering, can be done without a mouse.
Answers: 1
You know the right answer?
In this Java programming assignment, you will practice using selection statements to determine wheth...
Questions
question
Mathematics, 04.05.2020 23:59
question
Mathematics, 04.05.2020 23:59
question
Mathematics, 04.05.2020 23:59
question
Mathematics, 04.05.2020 23:59
Questions on the website: 13722362