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

Questions by Mandar Tarkunde   answers by Mandar Tarkunde

Showing Answers 1 - 4 of 4 Answers

Praveen

  • Oct 17th, 2006
 

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);}}

  Was this answer useful?  Yes

Test Case :

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

  Was this answer useful?  Yes

Give your answer:

If you think the above answer is not correct, Please select a reason and add your answer below.

 

Related Answered Questions

 

Related Open Questions