Pair Programming - Vowels in Baby Names
Introduction
In the final exam for the Fundamentals of Programming course in the fall I asked you to write code that worked with a large file of baby names. It was divided into two parts
First, create a function called countVowels(). This function should:
- Take in one string as a parameter
- Return a single integer indicating the number of vowels (including y) in the string.
- It should work with both upper-case and lower-case letters.
Second, create a function called nameAnalysis() This function should:
- Take in two parameters
- the name of a file to analyze
- the string "boy" or "girl"
- The function should calculate the average number of vowels in the names in the file for the gender provided as the second parameter.
- It should print a final, well-formatted, message at the end about the average number of vowels in names for each gender.
- Returns nothing. The results of this are displayed in the print statement.
Data
You will need the following data files
Submission
I will be grading this on purely a 1/0 basis. You get credit for submitting something "on time" and that shows that you put time and effort/thought into crafting the code.
Please complete in Replit in the appropriate activity/assignment.