CPSC 3400 Assignment #2 solved

$35.00

Category: You will receive a download link of the .ZIP file upon Payment

Description

5/5 - (1 vote)

P2 expands your understanding of Python constructs and code reuse.

Submitted programs must:
1) provide the requested functionality
2) be appropriately documented (thorough but concise)
3) use Python constructs as intended (do NOT write a C-style program)

ALL ASSUMPTIONS SHOULD BE REASONABLE AND CLEARLY STATED
DO NOT HARD CODE

Write a Python program that:
1) examines the contents of five text files
a. use CL (command line — sys.argv ) to extract ONE filename
i. all files will have the same name except for the last character
ii. the last character of the name will be a digit (1, 2, 3, 4, or 5)
b. do NOT hardcode filenames
c. do NOT prompt the user for filenames
2) extracts words from the files
a. Only alphabetic data should be considered.
b. Punctuation and digits should not be considered.
3) for every pair of files, determines the words that occur in both files (overlap)
4) orders the 10 pairs of files by
a. the largest degree of overlap
b. the smallest degree of overlap
5) outputs the words that occur
a. in exactly one file
b. in exactly two files
c. in exactly three files
d. in exactly four files
e. in all files

Each submitted program will be tested on the same input files
TEST YOUR PROGRAM BEFORE SUBMISSION

Name your Python file: P2.py
Upload to Canvas