Pseudo Code: Output Position of First and Last Occurance - CAT
Not what you're looking for? Search our solutions OR ask your own Custom question.
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"
See attached file for full problem description.
© BrainMass Inc. brainmass.com December 24, 2021, 6:21 pm ad1c9bdddfhttps://brainmass.com/computer-science/pseudocode/pseudo-code-output-position-occurance-cat-107771
Solution Preview
(a) When we first find 'CAT', we use break to jump out of the while loop.
POS records the current position of 'CAT'.
Count = 0
POS = 0
While POS < 100
POS = POS + 1
IF BOOK(POS) = 'CAT' ...
Solution Summary
The solution modifies the pseudo code to an output position of the first and last occurrence of the word "CAT."
$2.49