讲解:Python:COMP1011 Programming For The WebPython

代写Python基础作业,分为三个模块,包括基本数学问答,HTML生成器以及Web的数据分析器。OverviewThis resit coursework incorporates all the main aspects of Python and web-based programming that were covered in the COMP1011 module:Part 1 (worth 30 marks) involves basic Python programming and is not specifically web-related and requires skills similar to those used in Courswork 1 of the module.Part 2 (worth 10 marks) concerns using Python to extract information from a CSV file and display it, firstly in simple text output to the console, and then as an HTML web page. This requires skills similar to those that were tested in Coursework 2 of the module.Part 3 (worth 10 marks) is about retrieving data from an online repository and finding and displaying specific information from that data. This is also related to the coding that was required for Coursework 2 of the module.It is suggested that as well as using the general material on the module website at students also look at the specifications for the original courseworks (under the ‘Coursework’ tab on that website), which contain various relevant tips and suggestions.SubmissionYour files must be submitted as a Zip archive. No other format will be accepted. Your solution should be submitted via the Blackboard VLE before the deadline. All submissions will be submitted to plagiarism detection software.The files you should submit are the following:maths quiz.pydisplay playlist.pyearthquakes.pyPart 1 Mathematical Quiz ProgramFor this part of the coursework you should write a console-based arithmetic quiz program. Your code should be in a file called maths quiz.py. The program should output a sequence of simple mathematical questions concerning addition, subtraction, multiplication, division, and possibly other kinds of arithmetic calculation. For example, one of the questions could be:What is the value of 4 + 7 ? After outputting each question, your program should prompt the user to enter an answer. You should restrict your quiz to questions and answers involving only whole numbers (some of which might be negative). However, within this limitation, a variety of different kinds of questions may be asked.To obtain higher marks, you will need to produce a program that does not always give the same quiz but generates different questions randomly each time it is run. Marks will be awarded depending on the length, complexity, diversity and other features of you program, according to the following mark scheme:(a) Appropriate, informative and concise text is displayed explaining the purpose of the program, prior to starting the actual quiz.(b) At least one question is asked.(c) Five or more questions asked.(d) Ten or more questions asked.(e) A variety of different types of questions are asked. The types of question can be: addition, subtraction, multiplication, division, calculating the square or square root of a number etc.(f) The program keeps a total of the number of questions correctly answered and outputs this, along with suitable text, at the end of the quiz.(g) The program checks that all answers input by the user are whole numbers. If not the program does not crash but tells the user that they must enter a whole number (possibly negative) and asks the question again.(h) The program generates a new random quiz each time. You should import the random module which provides a function that returns a random integer in a given range. You should use this both to select the type of each questPython代写:COMP1011 Programming For The Web代写Python实验ion and also the particular numbers that the question asks about. (You will need to import the random module to do tackle this part of the question.)(i) The program allows multiple quizzes to be run. After each quiz is completed the user is prompted regarding whether they wish to do another quiz or quit.(j) After taking a quiz, as well has having the options of doing another quiz or quitting, the user has the further option of redoing the same quiz as they have just done. (You can only obtain marks for this if your program generates random quizzes, as specified in part (h)).(k) The program includes suitable informative comments, including a brief description of what has been implemented at the top of the program file.Part 2 Generating HTML from a CSV Data FileYour goal for this part of the coursework is to write a Python program that can read information about music tracks from a CSV file (i.e. a file in Comma Separated Value format) and output the information in an easily readable format. For the first part of this question you will display the information in a plain text format and for the second part you will generate an HTML file that can be viewed in a browser.(a) Write a Python program in a file called display playlist.py that includes a function display playlist(filename) that will read information from the example file geek-music.txt, or any file formatted in a similar way, and produce a list of track information that is output to the console in the format shown below.(b) Add to your program display playlist.py a function make html playlist(filename) which (as for part (a)) reads in information from a CSV file in the format of geek-music.txt and creates an HTML file, which, when viewed in a browser, displays the information content of the original file in a clear and visually pleasing way. The web page should have a heading which says which playlist it was generated from. You should use an HTML element to lay out the information. The table should have a border and you should set the table background colour. You should use different fonts for each of the columns of the table.Part 3 Accessing and processing information from the WebFor this part of the coursework, you should start with the file earthquakes.py, which you can download from the VLE. This contains functions to extract earthquake data, either from a file (function readDataFromFile) or from the online data provided by the US Geographical Society (USGS) (function readDatafromURL). To answer this question, add code to that file and submit your extended version of earthquakes.py.(a) Wite a function offlineDisplayLargestQuake() that will extract data from the earthquakedata.csv file, find the largest magnitude quake and display information about that quake. (Hint: Your code will be easier to construct if you first write: a function to display information for any quake record in the list of earthquake data, a function to find the quake record with the highest magnitude in the list.)(b) Wite a function onlineDisplayLargestQuake() that will extract data from the online USGS earthquake data resource and display it in similar fashion to the previous part.(c) Write a third function displayLargestQuake() that will first try to download the onlineUSGS data but if this fails will use the local earthquakedata.csv file. In either case it should display the largest magnitude quake, as for the previous functions. The output should also inform the user whether the online or local data is being used.转自:http://ass.3daixie.com/2019010525980525.html

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

推荐阅读更多精彩内容

  • By clicking to agree to this Schedule 2, which is hereby ...
    qaz0622阅读 1,446评论 0 2
  • 前段时间一直有宝妈问我关于孕期产后妊娠纹的问题,其中一位宝妈神清十分萧然的对我说,妊娠纹几乎快要将她逼疯了,她自己...
    sky9901阅读 1,017评论 0 0
  • 第二天吃药比前一天总体来说要好很多,大宝从刚开始的拒绝,到完全接受自己拿着药喝,前后也就半个小时的时间。我以为他会...
    爱文字的心理人阅读 124评论 2 2
  • 一天,农民在森林里游玩里,突然,农民看见有一个黑色的影子从他眼前飘了过去。 农民的眼睛很尖,一眼就看出那是狐狸,于...
    张耕铭阅读 945评论 0 2