Follow the Powerpoint for adapting the Python program and for the word document read the lines and input the variable , data type, etc based on the python program
Program Development Plan (PDP): [program_name].py 1. Problem Definition – state the real-world problem or need that the program solves, and the result desired. [add description ~ 3 lines] 2. Problem Analysis – list of functions and variables needed, with data type and data source for each variable. Note: primary analysis of a variable is done in the function where it originates. Function: [name, purpose] Variable Name Variable Data Type & Scope Variable Data Source Function: [name, purpose] Variable Name Variable Data Type & Scope Variable Data Source 3. Algorithm Development – list out program steps in order, including function calls. For subroutines and branching logic, use indentation and/or illustration features of Word to show the flow a. Main flow b. Main flow i. Subroutine (function call) · Conditional · Conditional c. Main flow i. Subroutine (function call) i. Conditional ii. Conditional d. Main flow i. Subroutine (function call) i. Conditional ii. Conditional e. Main flow 4. Coding & Documentation – [program_name.py] – Submitted separately, fully commented. 5. Testing & Debugging – as you run the program, take screen snips of results, and paste into this section, with notes about issues. Test your program with expected and unexpected input. Test 1: [describe] Result 1: [paste snip of output] [repeat tests to cover expected and unexpected input] 6. Maintenance/ improvement for the future – fixes needed, plus ideas for improved program features in the next version of the program. · Development idea · Development idea · Development idea Programming Logic and Design ITEC 1150 Ch 12 Web Scraping Lab Projects 1 LAB ASSIGNMENTs Breakout 1) web_scraping1.py - write a program to download a .txt file from online, open and read the file, and then display the output. Note: you do NOT have to display the whole file or write to a .txt file (optional). IMPORTANT – you must find a different .txt file online to work with, other than the example shown here, and in the book. 2 This example program downloads, opens and reads a file, hosted at this address: You need to use a DIFFERENT.txt file. LAB ASSIGNMENTs, cont. Breakout 2) PDP_webscraping3.docx After doing adaptations and tests on the demo12_webscraping2.py file (in the Ch12 Lesson folder): Finish the PDP that was started during lab. But, in this PDP, section 6 will be different than usual. Here, imagine that you get a work assigmment to improve the program, and to make it better and more dynamic (user-driven). In section 6 of your PDP, write 2-3 sentences explaining how you could do each of the improvements below. Pseudo code or code should be provided. Add a restart feature to the program by … (finish explanation) Change the data source for the variable str_url so that the user can input a URL that they want to download. Do this by… HINT: include how you would provide basic correction/ validation of the input at minimum. Ultimate validation as a URL is optional. Change the data source for the variable str_filename so it's dynamic (we don't want each new file to overwrite the last one). To do this you could… IDEAS: provide some type of automated naming process (but avoid characters that shouldn't be in a file name). If the above steps are implemented in the program, and the user enters a valid URL, the program will run until it gets to the ExtractPoem function (see example output). But if you enter 'y' here, the program will fail, since some of the code is specific to the All Poetry website. CHALLENGE LEVEL for section 6: To make the ExtractPoem function work in the new, dynamic program, you could… No code required – ideas are fine! 3 Upload! Then…do active reading of CH 16 Comment your code - for every program! Save your programs, for future reference. Submit these files: web_scraping1.py, and PDP_web_scraping3.docx to the Ch 12 lab drop box before you leave class. Questions or need help? Ask before the deadline! 4