Question: Based on this Code create a Control Flow graph for each with corresponding test cases. A minimal set of test cases to ensure statement coverage.

Based on this Code create a Control Flow graph for each with corresponding test cases.

A minimal set of test cases to ensure statement coverage.

A minimal set of test cases to ensure branch coverage.

A minimal set of test cases to ensure condition coverage.

A minimal set of test cases to ensure Def-use coverage.

A minimal set of test cases to ensure Path coverage.

import java.util.Scanner; public class Triangles { public static void main(String[] args) { System.out.println("Enter 3 numbers"); Scanner input = new Scanner(System.in); int a=input.nextInt(); int b=input.nextInt(); int c=input.nextInt(); boolean c1 = 1 <= a & a <= 200; boolean c2 = 1 <= b & b <= 200; boolean c3 = 1 <= c & c <= 200; if (!c1) { System.out.println("Value of a is not in the range of permitted values."); } if (!c2) { System.out.println("Value of b is not in the range of permitted values."); } if (!c3) { System.out.println("Value of c is not in the range of permitted values."); } if (c1 && c2 && c3) { boolean isATriangle; isATriangle = a < b + c & b < a + c & c < a + b; if (isATriangle) { if (a == b & b == c) { System.out.println("Equilateral"); } else if (a != b & a != c & b != c) { System.out.println("Scalene"); } else { System.out.println("Isosceles"); } } else { System.out.println("NotATriangle"); } } } }

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!