HCU MCA 2015 Paper

Show Para  Hide Para 
Note: Answer questions 71 and 72 based on the following algorithm.
START
$STR := ’ ’ , $ASTR := ‘a’,
$BSTR : = ‘b’
WHILE LENGTH ($STR) < 100
INPUT OPTION AS 1 OR 2
READ OPTION INTO $OPT
IF ($OPT = 1) THEN
APPEND $ASTR IN THE BEGINNING OF $STR
APPEND $BSTR IN THE END OF $STR
END IF
IF ($OPT = 2) THEN
APPEND COPY OF $STR AT THE END OF $STR
ENDWHILE
OUTPUT $STR
END
© examsiri.com
Question : 72 of 75
 
Marks: +1, -0
The number of iterations, the algorithm will go through, is dependent on the sequence of options provided by the user. What is the minimum and maximum possible values for the number of iterations assuming that the first option provided by user is 1 ?
Go to Question: