MA1008 Introduction to Computational Thinking Mini Project, Weeks 10 – 13 Submission Deadline: 23:59, Friday 15 November 2019 Introduction This is a data visualisation project which requires you to...

entire code of Solution needed.


MA1008 Introduction to Computational Thinking Mini Project, Weeks 10 – 13 Submission Deadline: 23:59, Friday 15 November 2019 Introduction This is a data visualisation project which requires you to write a program to extract information from a given set of data and plot charts, so that you can visualise the data clearly and quickly. There are different types of charts. You can see a selection here: https://visme.co/blog/types-of-graphs/. You are required to write the program using Python and the graphics library that comes with IDLE, called Turtle, to create the charts from scratch. Turtle capabilities and functions are described fully in Section 24.1 of the Python documentation, which you can access via the IDLE interactive shell by clicking Help > Python Docs and then search for “Turtle”. Turtle provides the fundamental functions required for drawing, such as plotting points, lines and shapes, and controlling their attributes such as location, colour, line thickness, and more. You should study the different elements that are required in a chart, and add them to yours where appropriate. For example, a bar chart always has a pair of axes which are labelled with the type of data they represent. Each axis may have tick marks for different values, with the values written alongside. And of course, there are the actual bars, which may have different colours. You should learn to use the functions in Turtle that you require for displaying the elements. There are many Turtle functions, you only need to learn the ones you require. That’s why it is necessary that you work out what you need beforehand. What you and your program must do This project is designed for you to demonstrate your computational thinking ability and your skill with Python. It requires you to produce plots from a given set of data. The data for the exercise is contained in the file: “WorldPopulationData2019.txt”. This is a text file that your program needs to read. Do not edit this data file. Each line in the file contains the population data for a country, given in eight fields separated by “;”. The country name is given in the second field in the line. For a better view of what the fields represent, look at the accompanying equivalent Word file, “WorldPopulationData2019.docx” or the source website of the data http://statisticstimes.com/demographics/countries-by-population.php. There is a lot more useful information you can obtain from the table than just the numbers you see, if you process them appropriately. This project requires you to do some data processing and display the outcomes, by producing a program that extracts information from the data and, where appropriate, generates plots. You are required to provide at least four operations in your program, two of which must be: (1) (i) List the total populations of the different continents, and (ii) plot a pie chart showing the percentages of these populations. (2) (i) List the percentage population change in 2019 compared to 2018 for the different countries, in descending order. Your output should contain the country name, the 2019 population and the percentage change. (ii) Plot a bar chart or a line chart showing the changes of the top n countries with a negative change in percentage terms. n is a value the user can choose, that allows the plotting of a neat chart that is not overly congested. You can choose the other two operations, except for printing data in the way they are given. You can freely decide what results to produce, which may or may not be accompanied by a chart. There are many possibilities; here are a few more examples: - The user chooses a letter and your program lists the countries whose names start with that letter, together with their populations in 2019. - Which are the top n countries with the largest increase in population in 2019? https://visme.co/blog/types-of-graphs/ http://statisticstimes.com/demographics/countries-by-population.php - If we are to sum the populations of the countries, starting from the smallest in ascending order, how many countries are required to add up to the population of China in 2019? - For each continent, list the countries with the largest and the smallest populations. You need to provide a menu to allow the user to select the particular operation that they want to execute. You can design your own display of the menu, from being a simple text list to a graphical switchboard where the user can select the item they want. You are not allowed to use charting functions that you may find elsewhere on the Internet. In summary, here are what your program needs to do: 1. Read in the given data file 2. Provide a minimum of four operations (or functions) that extract information from the data and display the outcomes 3. Two of the operations are given above, which require plotting of charts, and the other two are of your own choosing 4. Provide a menu to allow the user to choose which operation to execute. It bears repeating that your program must read the data from the file, which must not be modified. The data must not be hard-coded into your program. The required information may or may not be directly available from the file. For example, the country population data is directly available, while the continent population data is not, and so you need to compute for them from the given data first. You should produce only one program with at least four operations, each requiring two or more inputs: (1) Data from the given data file (2) The user’s choice from the menu on the operation required (3) Depending on the operation, you might need to ask for further inputs, such as the number of countries to be included. Your program needs to allow the user to provide the inputs at run time. Upon the completion of the inputs, your program should proceed to generate the output and produce the plot if required. What you need to submit (1) The Python source file of your program. Remember to put your name and group number as a comment in the first line of your code. (2) A Word file containing a description of the operations you are providing, together with the outputs, including the charts where appropriate. You need to state clearly what the inputs are if they are not obvious. You can also explain any special features that you wish to highlight for each of the operations. Keep this file short. Excluding the program outputs and the charts, there should be at most half a page of description for each operation. Again, make sure that you have your name at the top of this Word file. When to submit The deadline for the submission is at 17:00 on Friday, 15 November 2019. How to submit The submission is to be made online into a submission folder set up for your group in the CAE Lab 2 Server. Therefore, you need to put your program into a thumb drive or cloud storage, and copy it into your group’s submission folder in the server. You can only do that in person at CAE Lab 2. The lab closes at 5 pm on a Friday, so don’t be late. You must name your file with your surname and initial. So, if you surname is Ang and your initials are B. C., your filename should be AngBC.py. The lab staff we help you if you don’t know how to submit. What we look for in the grading We will be looking for these things in the grading: (1) The quality of your algorithm, i.e. how well your algorithm works and whether it takes care of different possibilities that might occur. (2) The quality of your code. Given that this is a take home project with a long time span, we expect your code to run. Any code that does not run will suffer a large grade reduction. Also, remember that your code needs to be easily readable and understandable, so use meaningful names for the variables and add comments appropriately. You should handle any possible errors (such as in user inputs) gracefully. (3) The quality of your outputs. Your charts should be clearly understandable. Any display in the chart, including the labels, must be clear and neat. While we do not insist on a pretty display (as the judgement on that can be subjective), untidy ones will be penalised. The four required operations, together with the menu system for selection of the operations, will constitute 100% of your grade. Any extra operations you might provide will be used to help in improving your grade should your actual four operations leave room for improvement. Epilogue This is a take-home project for which you are given four long weeks. On average, if you spend 3 - 6 hours per week on the project, it is about right. Start right away. Do not wait till the last few days; you will not have enough time, because there are new things to learn beyond what has been covered in class. Develop the algorithm first, step by step, then the code. Work out what you need to do, and what facilities (i.e. functions) you need. You have to study the facilities Turtle provides; build on them and exploit them. But you don’t need to learn everything about Turtle because you don’t need them all. One of the first things you need to be able to do is to read the data file and store the data in your program, and then be able to access specific items, all systematically. You are welcome to consult and seek clarifications from your tutor, refer to books and the Internet, and even discuss with your peers. After all, this is how we all learn. But the construction of the program must be your very own. Any programs deemed to be copies of each other will be given a
Nov 12, 2021
SOLUTION.PDF

Get Answer To This Question

Related Questions & Answers

More Questions »

Submit New Assignment

Copy and Paste Your Assignment Here