Answered step by step
Verified Expert Solution
Question
1 Approved Answer
Java: Conditional testing, be clear! IsLeap Year Please write a JAVA program named IsLeap Year that prompts the user to enter a positive integer value
Java: Conditional testing, be clear!
IsLeap Year Please write a JAVA program named IsLeap Year that prompts the user to enter a positive integer value between 1600 and 2015 inclusive, that represents a year. As output, the program will display the date entered by the user and a statement indicating whether or not the value entered is that of a leap year. A leap year is defined by the following rules: Rule: If y is divisible by 4, then y is a leap year. Exception to the Rule: If y is also divisible by 100, then y is not a leap year. Exception to the Exception to the Rule: If y is also divisible by 400, then y is a leap year. Sample Input Data: 1999 is not a leap year because 1999 is not divisible by 4. 1624 is a leap year because 1624 is divisible by 4. 1900 is not a leap year because 1900 is divisible by 4 but is also divisible by 100. 2000 is a leap year because 2000 is divisible by 4, 100, and 400Step 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