Answered step by step
Verified Expert Solution
Question
1 Approved Answer
Exercise 2 You are given the following simple Java programs: Check for leap year. import java.util.Scanner; public class Demo { public static void main(String[] args)
Exercise 2 You are given the following simple Java programs: Check for leap year. import java.util.Scanner; public class Demo { public static void main(String[] args) { int year; Scanner scan = new Scanner (System.in); System.out.println("Enter any Year:"); year = scan. nextInt (); scan. close(); boolean isLeap = false; if (year % 4 == 0) if( year % 100 == 0) { if ( year % 400 == 0) isLeap = true; else isLeap = false; } else isLeap = true; } else { isLeap = false; } if(isLeap==true) System. out. println (year +" is a Leap Year."); else System.out.println(year + " is not a Leap Year."); } Using input partitioning and boundary conditions, please develop functional test cases for the method. You can define your test cases as input/output pairs, as in Exercise 1. [Hint: this is functional testing, so technically you do not need to view the code. However, the provided implementation may help you design effective test cases]
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