Question: Write a program called CountConsecutiveChars it reads strings from the user until the user presses enter without entering anything. it reports the number of characters
Write a program called CountConsecutiveChars it reads strings from the user until the user presses enter without entering anything. it reports the number of characters that appear consecutively in the string more than once (lets call that a "run") it also prints the length of the largest run. For example if the String is: "aaxbbb", then the sum of all characters that were repeated consecutively is 5 because 'a' repeats 2 times and 'b' repeats 3 times. The largest run was 3 (the b's). as usual, you cannot use topics we haven't covered yet. For instance, in this case you cannot use indexing of strings (chapter 10). For example: str[0] is the first character of string str, str[1] is the second, etc.
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
