Question: public static void testIsRightTri ( ) { / / * * * Test 1 * * * / / if ( isRightTri ( 3 ,

public static void testIsRightTri()
{
//*** Test 1***//
if(isRightTri(3,4,5)) System.out.println("Test 1 for isRightTri() PASSED");
else System.out.println("Test 1 for isRightTri() Failed");
//*** Test 2***//
if(isRightTri(4,5,3)) System.out.println("Test 2 for isRightTri() PASSED");
else System.out.println("Test 2 for isRightTri() Failed");
//*** Test 3***//
if(isRightTri(5,4,3)) System.out.println("Test 3 for isRightTri()) PASSED");
else System.out.println("Test 3 for isRightTri() Failed");
//*** Test 4***//
if(isRightTri(3,5,4)) System.out.println("Test 4 for isRightTri() PASSED");
else System.out.println("Test 4 for isRightTri() Failed");
//*** Test 5***//
if(isRightTri(5,3,4)) System.out.println("Test 5 for isRightTri() PASSED");
else System.out.println("Test 5 for isRightTri() Failed");
//*** Test 6***//
if(isRightTri(4,3,5)) System.out.println("Test 6 for isRightTri() PASSED");
else System.out.println("Test 6 for isRightTri() Failed");
//*** Test 7***//
if(!isRightTri(4,4,5)) System.out.println("Test 7 for isRightTri() PASSED");
else System.out.println("Test 7 for isRightTri() Failed");
}
public static void testToll520Bridge()
{
final double OFF_PEAK =1.75;
final double LOW_RUSH =2.40;
final double RUSH_HOURS =3.95;
final double MID_DAY =2.65;
//*** Test 1***//
if(toll520Bridge(5,20,"aa")==-1) System.out.println("Test 1 for toll520Bridge() PASSED");
else System.out.println("Test 1 for toll520Bridge() Failed");
//*** Test 2***//
if(toll520Bridge(5,65,"am")==-1) System.out.println("Test 2 for toll520Bridge() PASSED");
else System.out.println("Test 2 for toll520Bridge() Failed");
//*** Test 3***//
if(toll520Bridge(15,15,"am")==-1 && toll520Bridge(0,59,"am")==-1) System.out.println("Test 3 for toll520Bridge() PASSED");
else System.out.println("Test 3 for toll520Bridge() Failed");
//*** Test 4***//
if(toll520Bridge(12,0,"am")==OFF_PEAK && toll520Bridge(4,59,"am")== OFF_PEAK &&toll520Bridge(3,35,"am")== OFF_PEAK) System.out.println("Test 4 for toll520Bridge() PASSED");
else System.out.println("Test 4 for toll520Bridge() Failed");
//*** Test 5***//
if(toll520Bridge(5,0,"am")==LOW_RUSH && toll520Bridge(6,59,"am")== LOW_RUSH && toll520Bridge(6,03,"am")== LOW_RUSH) System.out.println("Test 5 for toll520Bridge() PASSED");
else System.out.println("Test 5 for toll520Bridge() Failed");
//*** Test 6***//
if(toll520Bridge(7,0,"am")==RUSH_HOURS && toll520Bridge(9,59,"am")== RUSH_HOURS && toll520Bridge(9,15,"am")== RUSH_HOURS) System.out.println("Test 6 for toll520Bridge() PASSED");
else System.out.println("Test 6 for toll520Bridge() Failed");
//*** Test 7***//
if(toll520Bridge(10,0,"am")==MID_DAY && toll520Bridge(3,59,"pm")== MID_DAY && toll520Bridge(3,55,"pm")==MID_DAY) System.out.println("Test 7 for toll520Bridge() PASSED");
else System.out.println("Test 7 for toll520Bridge() Failed");
//*** Test 8***//
if(toll520Bridge(4,0,"pm")==RUSH_HOURS && toll520Bridge(7,59,"pm")==RUSH_HOURS && toll520Bridge(6,15,"pm")==RUSH_HOURS) System.out.println("Test 8 for toll520Bridge() PASSED");
else System.out.println("Test 8 for toll520Bridge() Failed");
//*** Test 9***//
if(toll520Bridge(8,0,"pm")==LOW_RUSH && toll520Bridge(10,59,"pm")==LOW_RUSH && toll520Bridge(9,3,"pm")==LOW_RUSH) System.out.println("Test 9 for toll520Bridge() PASSED");
else System.out.println("Test 9 for toll520Bridge() Failed");
//*** Test 10***//
if(toll520Bridge(11,0,"pm")==OFF_PEAK && toll520Bridge(11,59,"pm")==OFF_PEAK && toll520Bridge(11,40,"pm")==OFF_PEAK) System.out.println("Test 10 for toll520Bridge() PASSED");
else System.out.println("Test 10 for toll520Bridge() Failed");
}
/** Method main()contains all the tests
* @param args the command line arguments
*/
public static void main(String[] args){
testIsRightTri();
testToll520Bridge();
}
}

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!