Question: a) Justify: What would be the effect if you replace && in line 3 with a & ? ( 3 Points ) b) Create the

a) Justify: What would be the effect if you replace && in line 3 with a & ? ( 3 Points )
b) Create the control flow graph of the method median(...) . Please write the source code, references to the line numbers of the method are not sufficient. ( 8 Points )
c) Specify a test case (minimum input numbers) which satisfies the statement coverage for the method median (...) . Enter the paths that have been traversed. ( 4 Points )
Given the following method 01 public static double median (double] d) f 02 double median - Double.NaN 03 if (d != null && d. length > 0) 04 if (d.length1) f 05 06 else f 07 Arrays.sort(d); // sorted ascending 08 int mid d.length / 2; 09 if (d.length % 2 !-9) { 10 11 else f 12 mediand[e]; median dlmid], median = (d[mid - 1] + d[mid]) / 2; 14 16 return median; a) Justify: What would be the effect if you replace "&&" in line 3 with a "&"? (3 Points) b) Create the control flow graph of the method median(...). Please write the source code, references to the line numbers of the method are not sufficient. (8 Points) c) Specify a test case (minimum input numbers) which satisfies the statement coverage for the method median (...). Enter the paths that have been traversed. (4 Points) Given the following method 01 public static double median (double] d) f 02 double median - Double.NaN 03 if (d != null && d. length > 0) 04 if (d.length1) f 05 06 else f 07 Arrays.sort(d); // sorted ascending 08 int mid d.length / 2; 09 if (d.length % 2 !-9) { 10 11 else f 12 mediand[e]; median dlmid], median = (d[mid - 1] + d[mid]) / 2; 14 16 return median; a) Justify: What would be the effect if you replace "&&" in line 3 with a "&"? (3 Points) b) Create the control flow graph of the method median(...). Please write the source code, references to the line numbers of the method are not sufficient. (8 Points) c) Specify a test case (minimum input numbers) which satisfies the statement coverage for the method median (...). Enter the paths that have been traversed. (4 Points)
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
