exam questions

Exam CTFL All Questions

View all questions & answers for the CTFL exam

Exam CTFL topic 1 question 119 discussion

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

Consider the following pseudo code:
1 Begin
2 Read Time
3 If Time < 12 Then
4 Print(Time, "am")
5 Endif
6 If Time > 12 Then
7 Print(Time 12, "pm")
8 Endif
9 If Time = 12 Then
10 Print (Time, "noon")
11 Endif
12 End
If the test cases Time = 11 and Time = 15 were input, what level of decision coverage would be achieved?

  • A. 100% or 6/6
  • B. 50% or 3/6
  • C. 67% or 4/6
  • D. 83% or 5/6
Show Suggested Answer Hide Answer
Suggested Answer: D 🗳️
Test case 1 exercises the decision outcomes True, False, False
Test case 2 exercises the decision outcomes False, True, False
This leaves the True outcome of decision 3 not exercised.
Of the 6 possible decision outcomes, 5 have been exercised, so the decision coverage is 5/6 (about 83%).

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
Nango
3 years, 2 months ago
can someone please explain why the answer is D?
upvoted 2 times
...
nj_a
3 years, 6 months ago
I think 4/6 is correct C.
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