BCS-ISEB
BH0-010 · Question #10
Given the following sample of pseudo code: 01 Input number of male rabbits 02 Input number of female rabbits 03 If male rabbits > 0 and female rabbits > 0 then 04 Input Do you want to breed (Yes /…
The correct answer is B. male rabbits = 1, female rabbits = 1, breed = "no". See the full explanation below for the reasoning.
Question
Given the following sample of pseudo code:
01 Input number of male rabbits 02 Input number of female rabbits 03 If male rabbits > 0 and female rabbits > 0 then 04 Input Do you want to breed (Yes / No) 05 If breed = "No" 06 Print "Keep male and female rabbits apart!" 07 End if 08 End If. Which of the following test cases will ensure that statement "06" is executed?
Options
- Amale rabbits = 1, female rabbits = 1, breed = "yes".
- Bmale rabbits = 1, female rabbits = 1, breed = "no".
- Cmale rabbits = 1, female rabbits = 2, breed = "yes".
- Dmale rabbits = 1, female rabbits = 0, breed = "no".
How the community answered
(28 responses)- A7% (2)
- B82% (23)
- C7% (2)
- D4% (1)
Community Discussion
No community discussion yet for this question.