Question: Course: Applied OO Programming Part 1 Write a program (homework_part1.py) that prompts the user to enter the name of a file (example: my_poem.txt) containing lines

Course: Applied OO Programming

Part 1

Write a program (homework_part1.py) that prompts the user to enter the name of a file (example: my_poem.txt) containing lines of text. The program will perform the following actions:

1. Display the contents of the file as a list.

2. Search for and display all words that begin with a vowel.

Include the following in your program logic

1. A function, read_file, that opens and reads the content of the file into a list. read_file function takes the name of the file as a parameter. It reads the contents of the file into a list and returns the list.

2. A function, vowel_words, that takes the list containing the contents of the file and returns a list containing words that begin with a vowel.

Part 2

Write a test case module (unittest_vowel_words.py) for the vowel_words function. The module will include the following:

1. Import the module for Part1 (homework_part1).

2. Test case class that tests the vowel_words function. The class will include a test method, test_vowel_words.

3. Logic in the test_vowel_words method for testing/validating the vowel_words function.

4. Main logic that executes the test case.

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!