Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

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.


Part 1 Example:



imageimageimage

Part Two Example:
imageimageimage

Enter the name of a file: the_road_not_taken.txt

Step by Step Solution

3.44 Rating (163 Votes )

There are 3 Steps involved in it

Step: 1

homeworkpart1py def readfilefilename with openfilename r as file lines filereadline... blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Introduction To Java Programming And Data Structures Comprehensive Version

Authors: Y. Daniel Liang

12th Edition

0136520235, 978-0136520238

More Books

Students also viewed these Programming questions

Question

Did the researcher do a dependability audit?

Answered: 1 week ago