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.
Here is the data.py file:
# Data Module
def get_phone_info_list(): """ Returns a list of phone data """
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
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!