You should construct a Python 3 program containing your solution to the following problem and submit your program electronically on Moodle. No other method of submission is allowed. Your program will be automatically run on Moodle for sample test cases provided in the project sheet if you click the “check” link. However, your submission will be tested thoroughly for grading purpose by teaching team after the due date. Remember you need to submit the program as a single python file and copy-paste the same program in the provided text box. You have only one attempt to make the submission so don’t submit if you are not satisfied with your attempt. All open submissions at the time of deadline will be automatically submitted. There is no way in the system to open the closed submission and reverse your submission.
You are expected to have read and understood the University’s guidelines on academicconduct. In accordance with this policy, you may discuss with other students the general principles required to understand this project, but the work you submit must be the result of your own effort. Plagiarism detection, and other systems for detecting potential malpractice, will therefore be used. Besides, if what you submit is not your own work then you will have learnt little and will therefore, likely, fail the final exam.
You must submit your project before the submission deadline listed above. Following policy, a late penalty of 5% will be deducted for each day (24 hours), after the deadline, that the assignment is submitted. No submissions will be allowed after 7 days following the deadline except approved special consideration cases.
This project is an extension to Project 1 but has different requirements. As mentioned earlier that the year 2020 will be regarded as a pandemic year in the history of mankind. COVID-19 impacted the entire world in such a manner that no other virus has ever done in the history. It’s been more than a year for the virus and still the uncertainties are looming all over the world.
Center for Systems Science and Engineering at John Hopkins University is regularly gathering the data about the COVID-19 spread and publishing it regularly at https://ourworldindata.org/coronavirus-source-data. This data is sourced from governments, national and subnational agencies across the world and publicly available for researchers and analysts.
In this project, you are required to write a computer program which can read the data from a csv (comma separated values) file provided to you and return different analytical results of the COVID-19 cases for entire world. Your program should follow the following specifications.
Specification: What your program will need to do
Your program must define the function main with the following signature:
The input arguments are:
csvfile is the name of the CSV file containing information and record of the COVID-19 cases which needs to be analysed. The first row of the CSV file will contain the headers. From the second row, each row contains the corresponding data to its header. We do not have prior knowledge about the number of columns or rows available in the CSV file.
The function is required to return the following outputs in the order provided below:
A dictionary containing the country name as key and a list having the following data about that country as value.
o A list containing the total number of recorded positive cases of COVID-19 for each month of the year.
o A list containing the total number of recorded deaths due to COVID-19 for each month of the year.
o A list containing the total number of days for each month of year, when the recorded positive cases of COVID-19 for that month of the year were greater than the average recorded positive cases of that month of the year.
o A list containing the total number of days for each month of year, when the recorded deaths due to COVID-19 for that month of the year were greater than the average deaths due to COVID-19 for that month of the year.
A dictionary containing the continent name as key and a list having the data similar to above for each continent as value.
All lists should have values recorded for each month of the year in order from January to December. All returned output variables must contain numerical values rounded to four decimal places (if required to be rounded off). Remember not to round the values during calculations and round them only at the time of saving them in the output variables.
Download the Covid-data-for-project_2_sample.csv file from the folder of Project 2 on LMS or Moodle. An example interactions are:
Your program needs to validate the inputs to the main() function and gracefully terminate if invalid inputs are provided.
You program needs to terminate gracefully if the file cannot be found or opened.
For graceful terminations, you need to print the message related to the problem and return None for each output.
Your program needs to validate the input data from the file. Date in the file is expected to be in day/month/year format otherwise entire row needs to be discarded. All numeric data is expected to be numeric and any other recorded data (or no data) should be considered as zero (0).
Your program needs to consider that columns and rows of the csv file do not have any specific order or can be in any order (excluding header row).
Your program needs to interpret the header row to find the required columns. Your program needs to terminate gracefully if required columns cannot be found in the file.
Your program needs to convert all text data in the csv to be lower order alphabets.
Your program needs to consider that data can be missed for few days of the month and therefore needs to find averages based on the available number of days for which correct data is available (for output related to countries), whereas for continents, the program can assume that data exists for all days of the month.
Important grading instruction:
You will have noticed that you have not been asked to write specific functions. That has been left to you. However, it is important that your program must defines the top-level function main(). The idea is that within main(), the program calls the other functions. (Of course, these may call further functions.) The reason this is important is that when your program is tested, the testing program will call your main() function. So, if you fail to define main(), the testing program will not be able to test your program and your submission will be graded zero. Don’t forget the submission guidelines provided at the start of the project sheet.
Things to avoid:
There are a few things for your program to avoid.
You are not allowed to import any Python module. While use of the many of these modules, e.g. csv or math is a perfectly sensible thing to do in a production setting, it takes away much of the point of different aspects of the project, which is about getting practice opening text files, processing text file data, and use of basic Python structures, in this case lists and loops.
Do not assume that the input file names will end in .csv. File name suffixes such as .csv and .txt are not mandatory in systems other than Microsoft Windows.
Ensure your program does NOT call the input() or print() functions at any time (print() function can be used for graceful terminations only). That will cause your program to hang, waiting for input that automated testing system will not provide. In fact, what will happen is that the marking program detects the call(s), and will not test your code at all which may result in zero grade.
“You can order CITS1401 Assignment from our service and can get a completely high-quality custom paper. Our service offers any of the CITS1401 Academic paper written from scratch, according to all customers’ requirements, expectations and highest standards.”