Answered step by step
Verified Expert Solution
Link Copied!

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)

image text in transcribed

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

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Visual Basic6 Database Programming

Authors: John W. Fronckowiak, David J. Helda

1st Edition

ISBN: 0764532545, 978-0764532542

More Books

Students also viewed these Databases questions

Question

Identify techniques used by sports psychologists.

Answered: 1 week ago