Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

CS/CrCS 1120 (Python) - Spring 2023 LA1 Continental Data Computation - You take in the whole input file in bat format and print the desired

image text in transcribed
image text in transcribed
image text in transcribed
image text in transcribed
CS/CrCS 1120 (Python) - Spring 2023 LA1 Continental Data Computation - You take in the whole input file in bat format and print the desired output in the console. - You need to parse each line for the given bat file and find out the total population, total area, languages spoken for each continent that must be sorted. The output should contain the metainformation in the following order: 1) Name of Continent: String 2) Currency : String 3) Uiteracy_rate: int 4) Time_zone : int 5) Continent: String 6) Main tanguage: String 7)Most spoken language: String - The output for data.tot is as follows: Bane th Cprobent tive thampony iru Letere intir Be Cierefiet it itseren Thene tewarid 18 botreary thatein Guchetry. GHD. Geveriter bivine hitionere the the Bince iaceri - it it Menn higstern fatiuater Ciewent in: fiarl Whimine le CS/CYCS 1120 (Python) - Spring 2023 LA1 Continental Data Computation def parse_tapor, ine(input_file : Flowchart You must design a flowchart for each function to illustrate how function is designed. Also, you seed to design a flowchart to show how the drive code is designed in terms of how inputs are received, and the functions are called. Implementation Phase Using the pseudocode developed, write the Python code for your assignment. This is a two-week assignment. Testing Phase - The data.txt is given to you with its output. The output should match exactly. - Bulld your program incrementally, carefully testing each function as you go. Grading - You can eam about 115 points in this assignment. The 15 points counts towards your extra credit. - A correct program with correct output, with proper use of all the function is worth 100 points. - If you chose to not use python's split and build your own split function you will earn extra 10 points. - If you chose to find out the most spoken language in each continent, you will earn extra 5 points. Assignment Submission - Generate a. zip file that contains all your files including: Program Files Any input or output files Flowchart Pseudocode data_short.txt - Submit the .zip fle to the appropriate folder (Dropbox) on E-Learning- Lab Assignment 1 Continental Data Computation Concepts - Review of CS1110 concepts such as basic data structures, control flow structures, and functions in Python - Use flow chart to design a function Problem Specification - Your program is to caiculate the country information based on an input file. - Each input file contains the meta-information in the following order. 1) Name of Continent 2) Currency 3) Literacy_rate 4) Time_zone 5)Continent 6)Main Language 7)Most spoken language - For example, the data.bxt as input looks like: Canada, CAD, 59, 3.5, North Ameriaz, Enylah, french ust, uso, 56, -5, North America, Enclah Mexike, MXN, 91, - - North America, Spanibh France, tur, 99, 1, furope, French Germany, Eun, 92, 1, furspe, German tapan, ify, 98, 9, Asia, Iapanese China, CNY, 96, 8, Acha, Ohinese Braal, BRL, 92, -3, South America, Portuguese India, INV, 74, 5.5, Asha, Hindi, Englah Indoneio, IDi, 92, 7, Asia, indonerian Pakitan, PKR, 72, 5, Asis, Unde, Englith Bangladesh, nor, 72, 6, Asia, bengati Rustia, Rub, 91, 1, Curope, Ruvian Nigeria, NGN, 69, 1, Africa, Endlish Egrot, E6, 73, 2, Atrica, Arabic Wran, 1RR, 34, 3.5, Adis, Renian Turking, TR, 96, 2, Europe, Turbish venervels, Vf,98; 45, 5outh Amarich, Pertuguese How to Test - We have provided one test file "data.txt". - You should create file "data_short.txt" by yourself. - To create test cases for the program, you can create a series of input file with known data and corresponding expected output. Then, you can write test functions that use these input file and expected output to verify that the parse_input_file function is correct. - Once the find the correct output for "data.bxt", finish up your work by doing the same for "data_short.txt". Design Requirements Basic Structure Your code should be designed in a similar fashion to the following template. A more detailed template has been given to you in the assignment folder. Fuentions and their Description: - find_name: Find the name of the country from the list of strings. - find_currency: Find the currency of the country from the list of strings. - find_literacy_rate: Find the literacy rate of the country from the list of strings. - find_time_zone: Find the time zone of the country from the list of strings - find_continent: Find the continent of the country from the list of strings. - find_main_language: Find the main language of the country from the list of strings. - find_most_spoken_language: Find the most spoken language of the country from the list of strings. - parse_input_file: Open the input text file and parse input line by line and get details using the above mentioned functions. This Function outputs the sorted list as seen in the sample output - Main: Calls the pasrse_input_file with relevant document and prints the output. del find_ nave(1ine garta)? swefind the nane of the country fron the Hist of strangu.". def find_currency (Iine_parts): def find literacy rate(line parts): "WFind the titeracy race of the country figen the I1sr of stripason. det find_tite_zone(tine_garts): nowfind the tilin tone of the countery frun theilist of strifgu. det ifind_contioent (bineparts) : wewesind the comtinent of the country finon the.11st of strins. ... def find main. Iangage(1Itie parts)

Step by Step Solution

There are 3 Steps involved in it

Step: 1

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

Beginning C# 5.0 Databases

Authors: Vidya Vrat Agarwal

2nd Edition

1430242604, 978-1430242604

More Books

Students also viewed these Databases questions

Question

What were your most important educational experiences?

Answered: 1 week ago

Question

Which personal relationships influenced you the most?

Answered: 1 week ago