Question:

Pseudocode for continuous string of text?

by  |  earlier

0 LIKES UnLike

what would be the pseudocode for the following:

reads in a continuous string of text, character by character.

Should terminate when ‘z’ is input.

Should calculate and print:

· number of times ‘a’ is input.

· number of times ‘e’ is input.

 Tags:

   Report

1 ANSWERS


  1. START

    a_count = 0

    e_count = 0

    DO    

        READ in next char

        IF char = 'a' THEN INCREMENT a_count

        IF char = 'e' THEN INCREMENT e_count

    LOOP UNTIL char = 'z'

    PRINT a_count,e_count

    STOP

Question Stats

Latest activity: earlier.
This question has 1 answers.

BECOME A GUIDE

Share your knowledge and help people by answering questions.