exam questions

Exam CTFL All Questions

View all questions & answers for the CTFL exam

Exam CTFL topic 1 question 7 discussion

Actual exam question from iSQI's CTFL
Question #: 7
Topic #: 1
[All CTFL Questions]

Consider the following pseudo code
1. Begin
2. Read Gender
3. __Print "Dear"
4. If Gender = female
5. Print ("Ms")
6. Else
7. __Print ( "Mr")
8. Endif
9. End
How many test cases are needed to achieve 100 per cent decision coverage?

  • A. 1
  • B. 2
  • C. 3
  • D. 4
Show Suggested Answer Hide Answer
Suggested Answer: B 🗳️

Comments

Chosen Answer:
This is a voting comment (?). It is better to Upvote an existing comment if you don't have anything to add.
Switch to a voting comment New
laraerf
1 year, 7 months ago
B is correct
upvoted 1 times
...
Shoxybee99
2 years, 5 months ago
what is the statement coverage here guys?
upvoted 1 times
...
SivajiTheBoss
2 years, 6 months ago
Tip: un nested : 2 testcases (irrespective of count of If)
upvoted 1 times
...
subwaysandwich
3 years, 1 month ago
Selected Answer: B
Ans: B. Decision coverage = minimum number of test cases to cover all branches. In this case, there is only one if-else statement, which means that 2 test cases are required. Note that if they asked for 100% statement coverage, it would still be 2, because the "Dear" statement would be covered by both test cases.
upvoted 3 times
...
subwaysandwich
3 years, 1 month ago
Selected Answer: C
Ans: C. 3 tests are needed to check for "Dear", "Ms." and "Mr."
upvoted 1 times
subwaysandwich
3 years, 1 month ago
Please ignore this. I have revised my answer to B. See my other comment.
upvoted 1 times
...
...
Arcino12
4 years ago
1. Verify that "Dear" is displayed 2. Verify that "Ms." is displayed if gender is Female 3. Verify that "Mr." is displayed if gender is Male
upvoted 3 times
...
Community vote distribution
A (35%)
C (25%)
B (20%)
Other
Most Voted
A voting comment increases the vote count for the chosen answer by one.

Upvoting a comment with a selected answer will also increase the vote count towards that answer by one. So if you see a comment that you already agree with, you can upvote it instead of posting a new comment.

SaveCancel
Loading ...
exam
Someone Bought Contributor Access for:
SY0-701
London, 1 minute ago