Mini Quiz 2:
Choose the option below. The function part is the same for both options.
The
difference is in the complexity of the main program.
Suggestion: complete Option 1 first, then, if time permits, modify
the main to complete Option 2.
- Option 1 (100 points):
Write a function count_letter that has one parameter -
string. The function
counts and returns the number of lowercase letters in the string and the number of
uppercase letters in the string.
Write main that reads one string and calls the function count_letter to find
and print the
number of lowercase and uppercase letters in the input string.
- Option 2 (100 points): More complex version of main:
Write a function count_letter that has one parameter -
string. The function
counts and returns the number of lowercase letters in the string and the
number of
uppercase letters in the string.
Write main that
reads a sequence of strings and stores the strings in the list. You
can decide on the size of the list (user input or random). For each string, find
the number of lowercase and uppercase letters. Store counters in TWO additional
lists: one for lowercase and one for uppercase.
Find the string that has the most lowercase letters and the string that has the
most uppercase letters.