For the following piece of code, how many test cases are needed to get 100% statement coverage?

Procedure X

Read (Color) // Input color from user

IF (Color == “Red”) THEN

Call Roses(Color)

ELSEIF (Color == “Blue”) THEN

Call Violets(Color)


PRINT “User is no Shakespeare”


End Procedure X

A. 5

B. 3

C. 1

D. 2

Answer / toshimathur


Is This Answer Correct ?    0 Yes 0 No

Post New Answer

More Test Cases Interview Questions

pliz anyone give suggest me the test cases for shorting numbers in asc/desc order.

4 Answers   IBM,

Consider the following: Pick up and read the newspaper Look at what is on television If there is a program that you are interested in watching then switch the the television on and watch the program Otherwise Continue reading the newspaper If there is a crossword in the newspaper then try and complete the crossword A. SC = 1 and DC = 1 B. SC = 1 and DC = 2 C. SC = 1 and DC = 3 D. SC = 2 and DC = 2 E. SC = 2 and DC = 3

1 Answers   ISTQB,

How many test cases you will execute per day?

2 Answers  

how to write test cases for testing databases,especially for testing and writing test cases for stored procedures.any real time database testers.please answer me. some real time database tester please answer my question as soon as need is such that. else mail answer at

1 Answers  

Sir I m student I mreading sytem testing as my core paper I want to know how I can make Test case for smple Login Form

4 Answers   IBM,

This part of a program is given: WHILE (condition A) Do B END WHILE How many decisions should be tested in this code in order to achieve 100% decision coverage? A. 2 B. Indefinite C. 1 D. 4

1 Answers   ISTQB,

What is rhinohunt testing? urgent pls send the answer soon

0 Answers  

how to write test cases for sort drop down box containning 6 options in the drop down list.

3 Answers  

There is one scenario. On login page three fields are available i.e.Login id,Password and checkbox(having funtion remeber my password for 1 week). Please tell me test cases for checkbox.

6 Answers   eZest,

How would you do " Keeping two folders in sync testing"

0 Answers   HCL, Microsoft, ABC,

Write test cases to check the functionality of the shopping cart of an e-commerce website

4 Answers   Verizon, Optum, SpoonJoy,

i got Question from iflex-just client gave just functional spec but they didnt provide any detaill, supporting document.but they want with in ten days testplan and test cases.excuse ans like prototype method. Question is how will u start writing testcases?

6 Answers   iFlex,