Question: Help with assignment - generating one of three different reports for one of three different inputs using command line parameters. Here is the data.py file:

Help with assignment - generating one of three different reports for one of three different inputs using command line parameters.

Help with assignment - generating one of three different reports for one

of three different inputs using command line parameters. Here is the data.py

Here is the data.py file:

# Data Module

def get_phone_info_list(): """ Returns a list of phone data """

# Format ,,,,,, phones = \ [ "1,Samsung,Galaxy S7,32,Android,6.0 Marshmallow,349.99", "2,Samsung,Galaxy S8,32,Android,7.0 Nougat,399.99", "3,Samsung,Galaxy S9,32,Android,8.0 Oreo,499.99", "4,Samsung,Galaxy S10,32,Android,9.0 Pie,599.99", "5,LG,Stylo 2 Plus,8,Android,6.0 Marshmallow,299.00", "6,LG,K4,16,Android,5.1.1 Lollipop,349.00", "7,Google,Pixel,32,Android,7.1 Nougat,599.99", "8,Google,Pixel XL,32,Android,7.1 Nougat,549.99", "9,Motorola,Moto G,16,Android,5.0.2 Lollipop,299.99", "10,Motorola,Moto G Power,16,Android,5.0.2 Lollipop,249.99" ]

return phones

def get_tablet_info_list(): """ Returns a list of tablet data """

# Format ,,,,,, tablets = \ [ "1,Apple,iPad Mini,64,iOS,12.3,399.00", "2,Apple,iPad,64,iOS,12.3,329.00", "3,Apple,iPad Air,64,iOS,12.3,499.00", "4,Samsung,Galaxy Tab,8,Android,5.1.1 Lollipop,139.99", "5,Samsung,Galaxy Tab S3,64,Android,6.0 Marshmallow,549.99", "6,Microsoft,Surface Go,64,Windows,10 Home,469.00", "7,Microsoft,Surface Pro,256,Windows,10 Pro,1299.00", "8,Microsoft,Surface Book,128,Windows,10 Pro,1599.00", "9,Acer,Iconia B3,16,Android,7.0 Nougat,179.99", "10,Asus,ZenPad 10,64,Android,7.0 Nougat,401.98", "11,Asus,Transformer,64,Windows,10 Home,381.51" ]

return tablets

def get_laptop_info_list(): """ Returns a list of laptop data """

# Format ,,,,,, laptops = \ [ "1,Apple,MacBook Air,8,MacOS,10.13 High Sierra,1199.00", "2,Apple,MacBook,16,MacOS,10.13 High Sierra,1599.00", "3,Apple,MacBook Pro,16,MacOS,10.13 High Sierra,1699.00", "4,Lenovo,ThinkPad X1 Carbon,16,Windows,10 Home,1147.34", "5,Lenovo,ThinkPad X390 Yoga,16,Windows,10 Home,1869.00", "6,Lenovo,IdeaPad 130S,2,Windows,10 Home,274.99", "7,Dell,XPS 15,8,Windows,10 Pro,1329.99", "8,Dell,XPS 13,8,Windows,10 Pro,1199.99", "9,Dell,Inspiration 15 3000,4,Windows,10 Home,419.99", "10,Google,Pixelbook,8,Chrome OS,74,1299.00", "11,Asus,VivoBook F510UA Thin,8,Windows,10 Home,728.43", "12,Asus,Chromebook C523,4,Chrome OS,74,349.99" ]

return laptops

Here is a sample of the output expected:

file: # Data Module def get_phone_info_list(): """ Returns a list of phone

Total Marks Due Dates 30 TBD The following errors should be printed to the console for invalid parameters: Input type must be either phone, table or laptop Report type must be either text, csv or ison Overview Make sure you follow best practices for having a main function in this script. Create a module called reports in a reports.py file. Creates functions for the following three reports in this module: text report, csx report and ison report. The output format for the text report should be as follows: For this assignment you will be generating one of three different reports for one of three different inputs. . Input Types: : Phone Data Tablet Data Laptop Data Timestamp: Average Price: $ Maximum Price: $ Median RAM: GB Operating Systems: ,,,,,, Full marks will only be given to implementations that are reasonably efficient, i.e., there should NOT be a lot of copy and paste code. Requirements Use the join function to generate the csv output. The operating system should be the operating system value AND the version (i.e., Android 5.1.1 Lollipop) The format of the list of unique operating systems should look like: Android 5.1.1 Lollipop/Android 7.1 Nougat/Android 9.0 Pie The datetime format should be YYYY-MM-DD HH:MM The output format for the ison report should be as follows: The following table identifies the requirements for this assignment. Requirement The command line parameters are as follows: { main.px Where: data time": "", "device.type": "", number": , "min grice": , Input Type is phone, tablet or laptop Report Type is text, csy or ison . "max.price": operating systems": [ "CQ5 1>" "", Submit the following Python files in a zipfile called assignment1.zip to the Assignment 1 dropbox in D2L: main.px - Your implementation of the main script reports.px - Your implementation of a reports module data.py.- Provided with the lab 1 } Make sure you followed naming best practices and included RocStrlog in all functions. Grading Summary Implementation 30 marks Optional: Use the son module to generate the ison output. The operating system should be the operating system value AND the version (i.e., Android 5.1.1 Lollipop) The datetime format should be YYYY-MM-DD HH:MM. Correct Output for each input type and report type (see Example Run Configurations to Test below). Full marks will be given for correct output and efficient implementation (limited redundant code). As per the requirements described above AND the test_main.py unit test. Marks will be subtracted for each violation of naming standards or missing DocString Total Example Run Configurations to Test 20 marks There are nine run configurations that must be tested: main.py phone text main.ex. phone csv main.py phone ison main.py tablet text . maio.py tablets malopy tablet ison main.py laptop text main.py laptop csv main.py laptop ison Best Practices Variable names should be lower snake.case Function names should be lower spake case All functions should include a RocString comment Sample Output The sample_output.txt file provides the expected output for each of the above run configurations. Your script must produce the same output. Submission Kvenv) C:\Courses\comp 1516\Assignment1Sample>python main.py, phone text Timestamp: 2020-09-07 14:29 Device: Phone Number: 10 Average Price: $419.79 Minimum Price: $249.99 Maximum Price: $599.99 Median RAM: 32.0 GB Operating Systems : Android 6.0 Marshmallow, Android 7.0 Nougat, Android 8.0 Oreo, Android 9.0 Pie, Android 6.0 Marshmallow, Android 5.1.1 Lollipop, Android 7.1 Nougat, Android 7.1 Nougat, Android 5.0.2 Lollipop, Android 5.0.2 Lollipop (veny) C:\Courses\comp1516\Assignment1Sample>python main.py phone csv 2020-09-07 14:29, Phone, 10,419.79,249.99,599.99, 32.0, Android 6.0 Marshmallow/Android 7.0 Nougat/Android 8.0 Oreo/Android 9.0 Pie/Android 6 .0 Marshmallow/Android 5.1.1 Lollipop/Android 7.1 Nougat/Android 7.1 Nougat/Android 5.0.2 Lollipop/Android 5.0.2 Lollipop (veny) C:\Courses\comp1516\Assignment1Sample>python main.py phone json "date_time" : "2020-09-07 14:29", "device_type": "Phone", "number": 10, "average_price": 419.79, "min_price": 249.99, "max_price": 599.99, "median_ram": 32.0, "operating systems" : [ "Android 6.0 Marshmallow", "Android 7.0 Nougat", "Android 8.0 Oreo", "Android 9.0 Pie", "Android 6.0 Marshmallow", "Android 5.1.1 Lollipop", "Android 7.1 Nougat", "Android 7.1 Nougat", "Android 5.0.2 Lollipop", "Android 5.0.2 Lollipop" (veny) C:\Courses comp1516\Assignment1Sample>python main.py, phone text Timestamp: 2020-09-07 14:30 Device: Phone Number: 10 Average Price: $419.79 Minimum Price: $249.99 Maximum Price: $599.99 Median RAM: 32.0 GB Operating Systems: Android 6.0 Marshmallow, Android 7.0 Nougat, Android 8.0 Oreo, Android 9.0 Pie, Android 6.0 Marshmallow, Android 5.1.1 Lollipop, Android 7.1 Nougat, Android 7.1 Nougat, Android 5.0.2 Lollipop, Android 5.0.2 Lollipop (venv) C:\Courses\comp1516\Assignment1Sample>python main.py phone csv 2020-09-07 14:30, Phone, 10,419.79,249.99,599.99, 32.0, Android 6.0 Marshmallow/Android 7.0 Nougat/Android 8.0 Oreo/Android 9.0 Pie/Android 6 .0 Marshmallow/Android 5.1.1 Lollipop/Android 7.1 Nougat/Android 7.1 Nougat/Android 5.0.2 Lollipop/ Android 5.0.2 Lollipop (venv) C: {Courses comp1516\Assignment1Sample>python main.py phone json "date_time" : "2020-09-07 14:30", "device_type": "Phone", "number": 10, "average_price": 419.79, "min_price":249.99, "max_price" : 599.99, "median_ram": 32.0, "operating systems": [ "Android 6.0 Marshmallow", "Android 7.0 Nougat", "Android 8.0 Oreo", "Android 9.0 Pie", "Android 6.0 Marshmallow", "Android 5.1.1 Lollipop", "Android 7.1 Nougat" "Android 7.1 Nougat", "Android 5.0.2 Lollipop", "Android 5.0.2 Lollipop" SAMPLE OUTPUT }

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!