Pseudo code-output position of first and last occurance-cat


Question:

Pseudo Code: Output Position of First and Last Occurance - CAT

Modify the pseudo code to (a) Output position of the first occurrence of the word "CAT" (b) Output the position of the last occurrence of the word "CAT"

B010
Enter
Count = 0
POS = 0
While POS < 100
POS = POS + 1
IF BOOK(POS) = ‘CAT' THEN
COUNT = COUNT + 1
(ELSE)
ENDIF
ENDWHILE
IF COUNT = 0 THEN
Write ‘Not Found'
ELSE
Write ‘Found', COUNT, ‘times'
ENDIF
Return

Solution Preview :

Prepared by a verified Expert
Software Engineering: Pseudo code-output position of first and last occurance-cat
Reference No:- TGS01936434

Now Priced at $20 (50% Discount)

Recommended (92%)

Rated (4.4/5)