JIT104 Building IT SystemsFall, 2019CRICOS 00213J Page 1Take-Home Task 1: Bubble Charts(Weight: 20%. Due: Friday 18 October 2019)OverviewThis is the take home task is worth 20% of your final grade for this unit.MotivationOne of the most basic functions of any IT system is to process a given data set to producesome form of human-readable output. This task requires you to produce a visual image basedon data stored in a list. It tests your abilities to:• Iterate through sequences of data values;• Perform arithmetic operations;• Display information in a visual form; and• Produce reusable code.GoalYou are required to write a Python program which processes data stored in a list to producea bubble chart. Bubble charts are a common way to visually display data sets that havevalues in three dimensions. They extend the familiar notion of a scatter plot, used to displaytwo-dimensional data on an x-y coordinate system, to include a third dimension by varyingthe sizes of the dots on the chart. In our case, however, we will not draw simple bubbles(dots), but will use the abilities of Turtle graphics to show the bubbles as icons which visuallyrepresent the data items whose values they portray.The data values to be displayed each consists of a quadruple, specifying the icon style, andthe corresponding x, y and z components for this data item. You are required to use Turtlegraphics to draw a corresponding bubble chart for each icon in a list, where the x and y valuesdetermine the position of the icon and the z value determines its size. Each icon drawn mustprecisely match the dimensions specified, and each icon must be clearly distinct. Yourprogram must work for any of the given data sets, and any other similar data sets in the sameformat. You have a free choice in the style of icons to be displayed, however.ExamplesTo get you started, you will find a Python template bubble_charts.py accompanyingthese instructions. When you run this program it will produce an empty coordinate grid asshown overleaf. Notice that a numeric scale, from −350 to 350 in the x and y directions, hasbeen displayed to help you position and proportion your icons accurately.JIT104 Building IT SystemsFall, 2019CRICOS 00213J Page 2In the Python template file you will also find several data sets in the form of lists, e.g.,Each element of the list is itself a list which specifies the style of a particular icon to bedisplayed and its components in the x, y and z dimensions. For instance, the first item indata_set_14 above requires us to draw an instance of Icon 1 at x coordinate 212,y coordinate −165, and of size 90. All measurements are in pixels. In all of the data sets, thereare only five styles of icon used, named Icon 0 to Icon 4. The x and y values willalways be in the range −350 to 350, and the z values will be in the range 0 to 350. (A weaknessof bubble charts is that they are not useful for presenting data that may have a negative zvalue.)Given such a data set, you are required to populate the coordinate grid with correspondingicons, at appropriate positions and of appropriate sizes. The figure overleaf shows a bubblechart drawn from the above data set. In this case our five icon styles are intended to look likethe logos for the classic DC Comics superheroes, Batman, Superman, Wonder Woman, TheFlash and Green Lantern.JIT104 Building IT SystemsFall, 2019CRICOS 00213J Page 3In this case our Icon 1 style bubble looks like Superman’s emblem. As per the givenvalues, it is centred on x coordinate 212 and y coordinate −165, and is of width 90 pixels.Similarly, our Icon 3 style bubble, represented by The Flash’s logo, is at x coordinate 84,y coordinate 208, and is of height 124 pixels.The size of each icon, i.e., its third or z’ value, defines the required width and/or height ofthe icon on the screen. Since the width and height of a chosen symbol may not be the same,the larger of these two values determines the icon’s size.To help you develop and calibrate your icons, we have provided five data sets, nameddata_set_00 to data_set_04, which draw just one icon each at several different sizes,including one in the exact centre of the chart. For instance, using data_set_00 our samplesolution produces the image below.JIT104 Building IT SystemsFall, 2019CRICOS 00213J Page 4In this case the specification [Icon 0, 0, 0, 100] has caused our program to drawBatman’s emblem precisely in the centre of the chart with an exact width of 100 pixels.Similarly, using data_set_03, the specification [Icon 3, 0, 0, 100] producesThe Flash’s logo in the centre of the chart with an exact height of 100 pixels, since this icon ishigher than it is wide.Finally, because you have a free choice of which five icons to draw,we need an explanation of what they are. You are thereforerequired to produce a legend on your chart, explaining to theviewer what the overall group of icons represents and what eachindividual one denotes. The legend may appear either to the rightor left of the coordinate grid. In our case, where the iconsrepresent superheroes, the legend is drawn as shown to the right.JIT104 Building IT SystemsFall, 2019CRICOS 00213J Page 5Putting all these elements together produces a complete bubble chart with a coordinate grid,icons of various sizes denoting data values in three dimensions, and a legend explaining whatthe icons represent. The following example was produced by our superheroes solutionusing data_set_09.Specific requirementsTo complete this task you are required to extend the given bubble_charts.py templatefile by completing the function draw_bubble_chart so that it can draw bubble charts byfollowing a given data set that specifies the style and dimensions of the icons to be displayed.In addition, your chart must include a legend explaining what each of the icons denotes.To get started, you first need to choose a collection of five icons to draw. These must all berelated in some way, must clearly be evocative of the subject they are intended to represent,and must be non-trivial. Simple geometric shapes, such as squares, circles, etc, are notacceptable. Suggested sources of ideas for sets of icons include the following.• Comic or cartoon characters• TV shows• Sporting teamsJIT104 Building IT SystemsFall, 2019CRICOS 00213J Page 6• PolitJIT104代做、代写IT Systems、Python设计ical parties• Countries or states• Brands of commercial products, e.g., soft drinks, fast food, etc• Automobile makes• Games• Companies, e.g., airlines, banks, etc• Educational institutions, e.g., universities or high schools• Media brands, e.g., newspapers, magazines, etcOther ideas are welcome, provided that they involve a set of non-trivial, clearly-distinct icons.Most importantly, you are not to copy the set of icon styles shown in this document. Insteadyou are strongly encouraged to be creative and to choose your own set of icons from somearea that interests you personally.Requirements and marking guideYou are required to extend the provided template by completing thedraw_bubble_chart function so that it can draw icons at the locations and of the sizesspecified by a dataset provided as a single parameter. Your code must work for all thesupplied datasets in the template file and any other data set in the same format.Your solution must have at least the following features.• Drawing five different styles of icon (5%). The icons must be clearly distinct in colourand shape. The icons must be non-trivial, i.e., they must not be simple geometricshapes such as circles and squares. We would expect that each icon would compriseat least two separate shapes and colours, typically more. Effort should be put intomaking your drawing of the icon look like the real one. (We admit that our Turtlebaseddrawing of Superman’s emblem is far from perfect, but it is still clear whichsuperhero it represents!). You may not import any modules or files into your programother than those already included in the given bubble_charts.py template. Inparticular, you may not import any image files for use in creating your icons. All fiveicons must be drawn using basic Turtle graphics functions only.• Drawing icons according to the datasets (see % breakup below, for a total of 11%).Your solution must work for all of the given data sets as well as when a randomlygenerated dataset is supplied (using the function generate_random_dataset).You may not change the data sets provided, but you can add additional sets if youlike. When your draw_bubble_chart function is called with a particular data set,the icons must be drawn to precisely match the specifications in the data set in termsof:o their style (ie which icons are drawn) (4%)o where the icon/s are drawn (4%); andJIT104 Building IT SystemsFall, 2019CRICOS 00213J Page 7o size (3%). Importantly, all features of each icon must scale proportionatelywhen it is drawn at different sizes.• Drawing the legend (2%). The legend must display at least each of the icons drawnaccording to the dataset. Alternatively you may choose to draw a complete set of allthe icons each time (regardless of the dataset). The legend must be easy to read andunderstand and must clearly identify what each icon represents.• Code quality and presentation (2%). Your program code must be presented in aprofessional manner. See the coding guidelines in the JIT104 Code Marking Guide forsuggestions on how to achieve this. All code must be easy to read and understand,thanks to:o clear uncluttered layout;o concise English comments, explaining each significant code segments purpose;o variable names that clarify their roles;o avoidance of magic numnbers;o code that avoides unnecessary duplication of code;o correct grammar and spelling.If you are unable to solve the whole problem, submit whatever parts you can get working.You will receive partial marks for incomplete solutions.Development hints• This is not a difficult task, but due to the need to create multiple icon styles that canbe drawn at different sizes, it would be very repetitive if you tried to code the wholesolution using ‘brute force.’ Instead you are strongly encouraged to design reusableparameterised functions to draw the icons to reduce the amount of code you need towrite. (And obviously you should use the same functions to draw the icons in thelegend and on the chart.)• To draw the icons you must use only the basic Turtle drawing functions. You may notimport any image files into your code.• If you are unable to complete the whole task, just submit whatever parts you can getworking. You will receive partial marksfor incomplete solutions. (The hardest part ofthis task is making the icons scalable to different sizes, so you may want to leave thisto last.)• To help you debug your code we have provided some data sets which don’t producerealistic looking bubble charts, but allow you to clearly see the dimensions of youricons. In particular, data sets 0 to 4 each draw one icon at different sizes, so you canuse these to guide your development of each icon style.JIT104 Building IT SystemsFall, 2019CRICOS 00213J Page 8DeliverableYou should develop your solution by completing and submitting the provided Pythontemplate file bubble_charts.py as follows.1. Complete the statement at the beginning of the Python file to confirm that this isyour own individual work by inserting your name and student number in the placesindicated. I will assume that submissions without a completed statement are notyour own work and they will not be marked.2. Complete your solution by developing Python code at the place indicated. You mustcomplete your solution using only the modules already imported by the providedtemplate. You may not use or import any other modules to complete this program.In particular, you may not import any image files into your solution.3. Submit a single Python file containing your solution for marking. Do not submit anarchive containing several files. Only a single file will be accepted, so you cannotaccompany your solution with other files or pre-defined images.Academic IntegrityThis assignment is for individual assessment only. That means the work you submit must beyour own work and not the work of anyone else. You are not permitted to collaborate withyour peers on this assignment, other than to discuss high-level strategies. You are notpermitted to ask or commission someone else to write the assignment for you, or help youwrite the assignment.If you are in any doubt as to what is permitted and what is considered a breach of academicintegrity, please talk to one of the teaching staff as soon as possible.Author: Colin Fidge (QUT)Revised: Donna Teague (QUTIC 2019)转自:http://www.3daixie.com/contents/11/3444.html
讲解:JIT104、IT Systems、Python、PythonR|SQL
©著作权归作者所有,转载或内容合作请联系作者
- 文/潘晓璐 我一进店门,熙熙楼的掌柜王于贵愁眉苦脸地迎上来,“玉大人,你说我怎么就摊上这事。” “怎么了?”我有些...
- 文/花漫 我一把揭开白布。 她就那样静静地躺着,像睡着了一般。 火红的嫁衣衬着肌肤如雪。 梳的纹丝不乱的头发上,一...
- 文/苍兰香墨 我猛地睁开眼,长吁一口气:“原来是场噩梦啊……” “哼!你这毒妇竟也来了?” 一声冷哼从身侧响起,我...