Overview
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
Report Types:
• Text
• CSV
• JSON
The input type and report type will be specified as command line parameters to the Python script (main.py) that you will be creating. You are provided with a Python module (data.py) that has functions that return a list of data for each of the above input types. You will also create a Python module (reports.py) with functions for generating each of the above report types.
Your assignment must have no syntax errors and must successfully run (i.e., no runtime errors) for all combinations of the above inputs and outputs. If the script or provided unit test cannot be run, you will receive a mark of zero on this assignment.
Marks will be based largely on the output from the provided unit test file (test_main.py) when run. 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
The following table identifies the requirements for this assignment
Requirement
Create a script in a main.py that takes in command line arguments.
The command-line arguments are as follows:
main.py <input type> <report type>
Where:
• Input Type is phone, tablet or laptop
• Report Type is text, csv or json
The following errors should be printed to the console for invalid parameters:
• Invalid number of command-line arguments.
• Input type must be either phone, tablet or laptop.
• Report type must be either text, csv or json.
Make sure you follow best practices for having a main function in this script.
You may also have other functions in this script that calculate the various statistics for the input data. For example:
def calculate_statistics(input_type):
"Calculates the statistics for the given input type and data "
# Return values such as:
# current_datetime, device_name, num_devices,
# avg_price, min_price, max_price, median_ram, oses
Create a module called reports in a reports.py file. Creates functions for the following three reports in this module: text report, CSV report, and JSON report.
The function signatures should look like this:
def text_report(date, type, num_devices, avg_price,
min_price, max_price, median_ram, oses):
pass
def csv_report(date, type, num_devices, avg_price,
min_price, max_price, median_ram, oses):
pass
def json_report(date, type, num_devices, avg_price,
min_price, max_price, median_ram, oses):
pass
The output format for the text report should be as follows:
Date: <date time or report>
Device: <device type – Mobile Phone, Tablet or Laptop>
CS 340 Milestone One Guidelines and Rubric Overview: For this assignment, you will implement the fundamental operations of create, read, update,
Retail Transaction Programming Project Project Requirements: Develop a program to emulate a purchase transaction at a retail store. This
7COM1028 Secure Systems Programming Referral Coursework: Secure
Create a GUI program that:Accepts the following from a user:Item NameItem QuantityItem PriceAllows the user to create a file to store the sales receip
CS 340 Final Project Guidelines and Rubric Overview The final project will encompass developing a web service using a software stack and impleme