nerdexam
ISTQB

ISTQB-CTFL · Question #122

Consider the following code: int premium=2500; if (age<30) { premium = premium +1500: } Which options suits for a correct combination of Boundary value and expected result. Assume first number as…

The correct answer is B. 29. 4000. In the given code snippet, the premium is increased by 1500 if the age is less than 30. Therefore, at the boundary value of age 29, the premium should be 2500 + 1500 = 4000, and at age 30, the premium should remain at its initial value of 2500, as the condition is no longer…

Test Techniques

Question

Consider the following code:

int premium=2500; if (age<30) { premium = premium +1500:

} Which options suits for a correct combination of Boundary value and expected result. Assume first number as boundary followed by expected result.

Options

  • A29, 1500
  • B
    1. 4000
  • C29, 2500
  • D30, 1500

How the community answered

(47 responses)
  • A
    6% (3)
  • B
    72% (34)
  • C
    17% (8)
  • D
    4% (2)

Explanation

In the given code snippet, the premium is increased by 1500 if the age is less than 30. Therefore, at the boundary value of age 29, the premium should be 2500 + 1500 = 4000, and at age 30, the premium should remain at its initial value of 2500, as the condition is no longer met. Option B correctly reflects this with 29, 4000 and 30, 2500 as the boundary value and the expected results,

Topics

#boundary value analysis#expected results#condition logic#premium calculation

Community Discussion

No community discussion yet for this question.

Full ISTQB-CTFL Practice