Write condition coverage test cases for the below:print "Hello World"if date $='01/01/2000' and time $ = '00:00:00 thenprint "Happy New Year"end ifprint date$print time$As
import java.io.*;class Example{ public static void main(String args[]){java.util.Date date=new java.util.Date(); DataInputStream dis=new DataInputStream(System.in);System.out.println("Hello World");System.out.println("Please enter the date & time"+System.in);if(date='01/01/2000' && time='00:00:00'){System.out.println("Happy new year");}else{System.out.println("Date and time is"+date);}}
1. To check whether all the time the result must start with "Hello World" 2. To check whether the date is other than 01/01/2000 then it must show a error message 3. To check whether the time is other than 00:00:00 then it must throw a error message 4.To check the date is 01/01/2000 and the time is other than 00:00:00 then it must throw a error message 5. To check the time is 00:00:00 and the date is other than 01/01/2000 it must throw a error message 6.to check whether the time is 00:00:00 and the date is 01/01/2000 then it must show the correct result
Write condition coverage test cases for the below:print "Hello World"if date $='01/01/2000' and time $ = '00:00:00 thenprint "Happy New Year"end ifprint date$print time$As
Profile Answers by Mandar Tarkunde Questions by Mandar Tarkunde
Questions by Mandar Tarkunde answers by Mandar Tarkunde