讲解:JIT104、IT Systems、Python、PythonR|SQL

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

©著作权归作者所有,转载或内容合作请联系作者
  • 序言:七十年代末,一起剥皮案震惊了整个滨河市,随后出现的几起案子,更是在滨河造成了极大的恐慌,老刑警刘岩,带你破解...
    沈念sama阅读 203,098评论 5 476
  • 序言:滨河连续发生了三起死亡事件,死亡现场离奇诡异,居然都是意外死亡,警方通过查阅死者的电脑和手机,发现死者居然都...
    沈念sama阅读 85,213评论 2 380
  • 文/潘晓璐 我一进店门,熙熙楼的掌柜王于贵愁眉苦脸地迎上来,“玉大人,你说我怎么就摊上这事。” “怎么了?”我有些...
    开封第一讲书人阅读 149,960评论 0 336
  • 文/不坏的土叔 我叫张陵,是天一观的道长。 经常有香客问我,道长,这世上最难降的妖魔是什么? 我笑而不...
    开封第一讲书人阅读 54,519评论 1 273
  • 正文 为了忘掉前任,我火速办了婚礼,结果婚礼上,老公的妹妹穿的比我还像新娘。我一直安慰自己,他们只是感情好,可当我...
    茶点故事阅读 63,512评论 5 364
  • 文/花漫 我一把揭开白布。 她就那样静静地躺着,像睡着了一般。 火红的嫁衣衬着肌肤如雪。 梳的纹丝不乱的头发上,一...
    开封第一讲书人阅读 48,533评论 1 281
  • 那天,我揣着相机与录音,去河边找鬼。 笑死,一个胖子当着我的面吹牛,可吹牛的内容都是我干的。 我是一名探鬼主播,决...
    沈念sama阅读 37,914评论 3 395
  • 文/苍兰香墨 我猛地睁开眼,长吁一口气:“原来是场噩梦啊……” “哼!你这毒妇竟也来了?” 一声冷哼从身侧响起,我...
    开封第一讲书人阅读 36,574评论 0 256
  • 序言:老挝万荣一对情侣失踪,失踪者是张志新(化名)和其女友刘颖,没想到半个月后,有当地人在树林里发现了一具尸体,经...
    沈念sama阅读 40,804评论 1 296
  • 正文 独居荒郊野岭守林人离奇死亡,尸身上长有42处带血的脓包…… 初始之章·张勋 以下内容为张勋视角 年9月15日...
    茶点故事阅读 35,563评论 2 319
  • 正文 我和宋清朗相恋三年,在试婚纱的时候发现自己被绿了。 大学时的朋友给我发了我未婚夫和他白月光在一起吃饭的照片。...
    茶点故事阅读 37,644评论 1 329
  • 序言:一个原本活蹦乱跳的男人离奇死亡,死状恐怖,灵堂内的尸体忽然破棺而出,到底是诈尸还是另有隐情,我是刑警宁泽,带...
    沈念sama阅读 33,350评论 4 318
  • 正文 年R本政府宣布,位于F岛的核电站,受9级特大地震影响,放射性物质发生泄漏。R本人自食恶果不足惜,却给世界环境...
    茶点故事阅读 38,933评论 3 307
  • 文/蒙蒙 一、第九天 我趴在偏房一处隐蔽的房顶上张望。 院中可真热闹,春花似锦、人声如沸。这庄子的主人今日做“春日...
    开封第一讲书人阅读 29,908评论 0 19
  • 文/苍兰香墨 我抬头看了看天上的太阳。三九已至,却和暖如春,着一层夹袄步出监牢的瞬间,已是汗流浃背。 一阵脚步声响...
    开封第一讲书人阅读 31,146评论 1 259
  • 我被黑心中介骗来泰国打工, 没想到刚下飞机就差点儿被人妖公主榨干…… 1. 我叫王不留,地道东北人。 一个月前我还...
    沈念sama阅读 42,847评论 2 349
  • 正文 我出身青楼,却偏偏与公主长得像,于是被迫代替她去往敌国和亲。 传闻我的和亲对象是个残疾皇子,可洞房花烛夜当晚...
    茶点故事阅读 42,361评论 2 342

推荐阅读更多精彩内容