CS FundamentalsHardService-company placement · ISTQB-style

A program classifies three side lengths as equilateral, isosceles, scalene or 'not a triangle' (when the two shorter sides sum to no more than the longest). Which test set covers all four output classes?

  1. A. (3,3,3), (3,3,6), (3,4,5), (1,2,4)
  2. B. (3,3,3), (3,3,5), (3,4,5), (1,2,3)
  3. C. (4,4,4), (2,2,3), (2,3,6), (5,5,9)
  4. D. (2,2,2), (4,4,7), (4,5,9), (1,1,5)

Correct answer: B. (3,3,3), (3,3,5), (3,4,5), (1,2,3)

(1,2,3) is degenerate (1 + 2 = 3), so it is 'not a triangle', and the others are equilateral, isosceles and scalene. In the first set (3,3,6) is not a triangle, so no isosceles case; the last two sets have no scalene triangle ((4,5,9) and (2,3,6) are degenerate or invalid).

More Software Engineering, Git and Cloud Basics questions

Exams that ask this topic