below, please design and create the minimum component test cases (Unit Test case) needed to bieve 100% statement covergage and 100% decision coverage. (Use question 2 template)
Page 11
1. /* Solve quadratic equations: ax2+bx+c=0 /
2.static void solveQuadratic Equations (float a, float b, float c) {
if (a== 0) { if (b=0) { 4.
3.
5.Console.WriteLine("The equation has no solution!");
6.
}
7.else {
8.Console.WriteLine("The equation has one solution: x {0}", (-c/b));
9.
10.}
11.
12.float deltabb4ac;
13.float x1;
14.float x2;
15.
16.if (delta > 0) {
17.
x1 (float)((-b + Math. Sqrt(delta)) / (2 * a));
18.x2 (float) ((-b Math. Sqrt(delta)) / (2 * a));
19.Console.WriteLine("The equation has two solutions: x1 {0} va x2 {1}", x1, x2);
20.
}
21.else if (delta == 0) {
22.x1 (-b/(2*a));
23.Console.WriteLine("The equation has dual solutions: x1 x2= {0}", x1);
24.
}
25.else {
26.
Console.WriteLine("The equation has no solution!"):
+ 100%
}
Zoom
Close