CSSE1001作业代做、Python程序语言作业调试、Pyth

2019-03-31  本文已影响0人  omy8564

CSSE1001 / 7030 Semester 1, 2019Assignment 1 (15 Marks)Due: Friday 29 March 2019 at 20:30IntroductionWelcome to Travel Inspiration!We are going to be building a travel recommendation program. Out of ideas where to travel? TravelInspiration has got you covered.The program will ask the user questions about their preferences in a travel destination. It will usethese to recommend the best match in a database of potential travel destinations.You are provided with a file travel.py, which serves as a template for the assignment. This file iswhere you should write the code for your solution. The file also provides an example of how to readthe data from the database, one destination at a time. You need to implement the functionality toquestion the user and perform the matching. The database is in the form of a text file,destinations.csv. You may edit this text file to add more destinations for testing.OverviewTasksThis assignment is broken down into six main tasks, grouped into two categories: Core1. Questions & Inputs2. First Exact Match3. Climate & Season Factor4. Interests? Advanced5. Input Validation6. Multiple InputsDo not attempt the advanced tasks unless you have implemented all the core tasks. Most of themarks for this assignment are assigned to the core tasks.Getting StartedThe archive a1_files.zip contains all the necessary files to start this assignment. It contains: travel.py: The main assignment file. Add your code to this file. destinations.csv: The destinations database, in Comma Separated Value (CSV) format. destinations.py: Code to help Python read from a database. You are not expected tounderstand the code in the destinations.py file. The provided travel.py demonstrateseverything you need to do to use this code.Core Tasks1. Questions & InputsThe first task involves creating the questionnaire and prompting the user for input. Your programmust duplicate the functionality demonstrated below.The final line of output is the recommended destination. For now, this should be None, but in thefollowing tasks this should be replaced with the recommended destination.You may assume that the user will only enter valid input.CSSE1001 / 7030 Semester 1, 2019Required OutputWelcome to Travel Inspiration!What is your name? DoraHi, Dora!Which continent would you like to travel to? 1) Asia 2) Africa 3) North America 4) South America 5) Europe 6) Oceania 7) Antarctica> 4What is money to you? $$$) No object $$) Spendable, so long as I get value from doing so $) Extremely important; I want to spend as little as possible> $$$How much crime is acceptable when you travel? 1) Low 2) Average 3) High> 3Will you be travelling with children? 1) Yes 2) No> 2Which season do you plan to travel in? 1) Spring 2) Summer 3) Autumn 4) Winter> 1What climate do you prefer? 1) Cold 2) Cool 3) Moderate 4) Warm 5) Hot> 4Now we would like to ask you some questions about your interests, on a scaleof -5 to 5. -5 indicates strong dislike, whereas 5 indicates strong interest,and 0 indicates indifference.How much do you like sports? (-5 to 5)> -5CSSE1001 / 7030 Semester 1, 2019How much do you like wildlife? (-5 to 5)> -2How much do you like nature? (-5 to 5)> -4How much do you like historical sites? (-5 to 5)> -1How much do you like fine dining? (-5 to 5)> -3How much do you like adventure activities? (-5 to 5)> -4How much do you like the beach? (-5 to 5)> -2Thank you for answering all our questions. Your next travel destination is:NoneUser input is bold, italic and blue.Your program must match this output exactly. Including spaces, spelling and punctuation. Yourprograms will be tested using an automated system that will match your program’s output with theexpected output. A mismatch in the output will result in the test failing. Note: Option lines, i.e.“ 1) Spring”, should begin with two spaces.Input RequirementsFor name, anything is valid. For general questions, the user input will be the value to the left of theparenthesis (i.e. 1-7 for continent; $, $$ or $$$ for money; etc.). For interest questions, the userinput will be an integer between -5 and 5, inclusive. For tasks 1 to 4, you may assume that the userinput is always valid.2. First Exact MatchExtend your program to output a recommended destination on the final line, instead of None.For this task, the recommended destination should be the first destination that meets the followingcriteria: The continent must match exactly (destination.get_continent()). If the user will be travelling with children, it must be kid friendly(destination.is_kid_friendly()). Cost must be less than or equal to the users response to the money question(destination.get_cost()). Crime cannot be greater than is acceptable to the user (destination.get_crime()).If no exact match is found, the recommended destination should be None.There is no difference between varying levels of cost and crime, provided they meet the aboverequirements. For example, if the user’s money response is $$, then a cost of either $ or $$ wouldbe equally valid.CSSE1001 / 7030 Semester 1, 20193. Climate & Season FactorIn addition to the requirements from 2. First Exact Match, the program must look for the best matchfrom all destinations, according to the following criteria: Matches the user’s climate preference exactly (destination.get_climate()). Has the greatest season_factor, for the user’s selected season (e.g.destination.get_season_factor(spring)).As above, if no exact match is found, the recommended destination should be None.4. InterestsExtend the matching criteria from task 3 to consider the user’s interests as well as the season factor.To do this, let score = season_factor * interest_score, where season_factor isdefined above (e.g. destination.get_season_factor(summer)) and the interest score isthe sum of the user’s response multiplied by the destination’s score, for each interest (sports,wildlife, nature, historical, cuisine, adventure, beach). More specifically:interest_score = responsesports * scoresports + responsewildlife * scorewildlife + responsenature * scorenature + responsehistorical * scorehistorical + responsecuisine * scorecuisine + responseadventure * scoreadventure + responsebeach * scorebeachWhere responseinterest is the user’s response for the given interest, and scoreinterest is thedestination’s score for the given interest (e.g. destination.get_interest_score(beach)).Advanced Tasks5. Input ValidationFor this task you may no longer assume that the user will enter valid input.If, for any question, the user enters invalid input, they should be asked the question again until theyenter valid input, as demonstrated in the example below.Input Validation Example...How much crime is acceptable when you travel? 1) Low 2) Average 3) High> 5Im sorry, but 5 is not a valid choice. Please try again.How much crime is acceptable when you travel? 1) Low 2) Average 3) High> 1...CSSE1001 / 7030 Semester 1, 20196. Multiple InputsExtend the continent and season questions to accept multiple inputs, so that the user can type inmultiple options separated by a comma, as shown below.A destination is now considered a match if it’s continent matches one of the user’s choices (there isno ordering; each choice is considered equally).The season factor used in calculating the score is now the greatest factor of those matching theuser’s choice.Extend your input validation to handle multiple inputs. Values can be repeated (i.e. “2,3,2” is a valid input). Numbers can have spaces around them (i.e. “2, 3 ,4” is a valid input). Numbers can be unordered (i.e. “1,4,3” is a valid input).You should first implement this task to handle the simple case, where the input does not haverepeated values, spaces or is unordered. Once this is working, then implement each type ofvalidation in turn. Marking will test to determine how much of the validation your implement, andyou can obtain part marks for partially implementing the validation for this section.Multiple Inputs Example...Which continents would you like to travel to? 1) Asia 2) Africa 3) North America 4) South America 5) Europe 6) Oceania 7) Antarctica> 1,2,7,3...Which seasons do you plan to travel in? 1) Spring 2) Summer 3) Autumn 4) Winter> 1, 3...Note that the words “continents” and “seasons” are now plural.Utility FunctionsTo implement the assignment you will need to use some utility functions provided in thedestinations.py file. The specific functions that you need to use for each task have beenidentified in the description above. The initial code inside travel.py provides an example of usingall of these functions. The following table indicates the type of the value returned by each of thefunctions.CSSE1001 / 7030 Semester 1, 2019Function Parameter Return Typedestination.get_name() no parameter stringdestination.get_crime() no parameter stringdestination.is_kid_friendly() no parameter booleandestination.get_cost() no parameter stringdestination.get_climate() no parameter stringdestination.get_continent() no parameter stringdestination.get_interest_score() string that is the name of theinterestintdestination.get_season_factor() string that is the name of theseasonfloatInterviewIn addition to providing a working solution to the assignment problem, the assessment will involvediscussing your code submission with a tutor. This discussion will take place in week 6, during thepractical session to which you have signed up. You must attend your allocated practical session,swapping to another session is not possible. In preparation for your discussion with a tutor youshould consider: any parts of the assignment that you found particularly difficult, and how you overcame themto arrive at a solution; or, if you did not overcome the difficulty, what you would like to ask thetutor about the problem; whether you considered any alternative ways of implementing a given function; where you have known errors in your code, their cause and possible solutions (if known).It is important that you can explain to your tutor the algorithmic logic of your program and howeach of the functions that you have written operates. (For example, if you have used a while loop ina function, why this was an appropriate choice).In the interview you must demonstrate understanding of your code. If you cannot demonstrateunderstanding of your code, this may affect the final mark you achieve for the assignment. Atechnically correct solution may not achieve a pass mark unless you can demonstrate that youunderstand its operation.SubmissionYou must submit your assignment electronically via the assignment one submission link onBlackboard. For information on submitting through Blackboard, please read:https://web.library.uq.edu.au/library-services/it/learnuq-blackboard-help/learnuqassessment/blackboard-assignmentsYou must submit your assignment as a single Python file called travel.py (use this name – alllower case), and nothing else. Do not submit the destinations.csv or destinations.py files.Do not submit any sort of archive file (e.g. zip, rar, 7z, etc.).Late submissions of the assignment will not be marked. Do not wait until the last minute to submityour assignment, as the time to upload it may make it late. Multiple submissions are allowed, soensure that you have submitted an almost complete version of the assignment well before thesubmission deadline of 20:30. Your latest, on time, submission will be marked. Ensure that yousubmit the correct version of your assignment.CSSE1001 / 7030 Semester 1, 2019In the event of exceptional personal or medical circumstances that prevent you from handing in theassignment on time, you may submit a request for an extension. See the course profile for detailsof how to apply for an extension.Requests for extensions must be made no later than 48 hours prior to the submission deadline. Theapplication and supporting documentation (e.g. medical certificate) must be submitted via my.UQ.You must retain the original documentation for a minimum period of six months to provide asverification, should you be requested to do so.Assessment and Marking CriteriaThis assignment assesses course learning objectives:1. apply program constructs such as variables, selection, iteration and sub-routines,3. read and analyse code written by others,5. read and analyse a design and be able to translate the design into a working program,6. apply techniques for testing and debuggingCriteria MarkProgramming Constructs Program is well structured and readable Identifier names are meaningful and informative Algorithmic logic is appropriate Functions are used to split logic into meaningful and useful blocks, with datapassed as parameters and returned appropriately Functions are well-designed, simple cohesive blocks of logicSub-Total 5.5Functionality1. Questions and Inputs2. First Exact Match3. Climate and Season Factor4. Travel Interests5. Input Validation6. Multiple Inputs�Sub-Total 7Documentation Comments are clear and concise, without excessive or extraneous text Program, and all functions having informative docstring comments Significant blocks of program logic are clearly explained by comments0.51.50.5Sub-Total 2.5Total / 15Your total mark will be constrained if your program does not implement all the core functionality(tasks 1 to 4). The following table indicates a multiplier that will be applied to your programmingconstructs and documentation marks based on how much of the core functionality your programcorrectly implements.CSSE1001 / 7030 Semester 1, 2019Functionality Correctly Implemented MultiplierTask 1 does not execute at all 25%Task 1 is partially working 35%Task 1 is completely working 50%Task 2 is mostly working 75%Task 3 is mostly working 85%Task 4 is mostly working 100%It is your responsibility to ensure that you have adequately tested your program to ensure that it isworking correctly.A partial solution will be marked. If your partial solution causes problems in the Python interpreterplease comment out the code causing the issue and we will mark what is working. Python 3.7.2 willbe used to test your program. If your program works correctly with another version of Python butdoes not work correctly with Python 3.7.2, you will lose at least all the marks for the functionalitycriteria.Please read the section in the course profile about plagiarism. Submitted assignments will beelectronically checked for potential plagiarism.CSSE1001 / 7030 Semester 1, 2019Detailed Marking CriteriaCriteria MarkProgramming Constructs 1 0.5 0 Program is well structured and readable Code structure highlights logical blocksand is easy to understand. Code doesnot employ global variables. Constantsclarify code meaning.Code structure corresponds to somelogical intent and does not make thecode too difficult to read. Code doesnot employ global variables.Code structure makes the code difficultto read. Identifier names are meaningful andinformativeAll variable and function names areclear and informative, increasingreadability of the code.Most identifier names are informative,aiding code readability to some extent.Most identifier names are not clear orinformative, detracting from codereadability. Algorithmic logic is appropriate Algorithm design is simple, appropriate,and has no logical errors.Control structures are well used toimplement expected logic.Algorithm design is not too complex orhas minor logical errors.A few control structures are a littleconvoluted.Algorithm design is overly complex orhas significant errors.Many control structures are used in aconvoluted manner (e.g. unnecessarynesting, multiple looping, …). Functions are used to split logic intosome meaningful and useful blocks, withdata passed as parameters and returnedappropriatelyFunctions represent useful logical functionalityand parameters and returnvalues are appropriate.Functions represent some useful logicalfunctionality and parameters and returnvalues are usually appropriate (e.g. toofunctions or they are too large).Functions are not used or are not usefullogical blocks. Parameters or returnvalues are not used or are notappropriate.Programming Constructs 1.5 1 0.5 0 Functions are welldesigned,simplecohesive blocks oflogicProgram is well-designed, splittingthe logic into an appropriatenumber of general functions,where each function performs asingle cohesive logical task.Program is split into a reasonablenumber of general functions.None are too complex or large.Program may use functionscorrectly, but some functions arelarge blocks of logic thatimplement multiple tasks. Or,parameters are not used well.Program makes little or no use offunctions. Functions implementedare often large and complexblocks of logic. Parameters maybe poorly used.CSSE1001 / 7030 Semester 1, 2019Functionality 1 0.5 0 Task 1: Questions & Inputs All prompts are correctly displayed andcan accept correct inputs.Most prompts are displayed and they canaccept correct inputFew prompts are displayed or mostcannot accept input. Task 2: First Exact Match In all cases finds the correct destinationmatch. (2 marks)In all simple cases finds the correctdestination match. (1 mark)In most cases does not find the correctdestination match. (0.5 or 0 marks) Task 3: Climate and Season Factor In all cases finds the correct destinationmatch.In all simple cases finds the correctdestination match.In most cases does not find the correctdestination match. Task 4: Travel Interests In all cases finds the correct destinationmatch.In all simple cases finds the correctdestination match.In most cases does not find the correctdestination match. Task 5: Input Validation Handles all invalid input strings Handles simple invalid inputs Does not handle any invalid inputs. Task 6: Multiple Inputs In all cases finds the correct destinationmatch.In all simple cases finds the correctdestination match.In most cases does not find the correctdestination match.Documentation 1.5 1 0.5 0 Comments are clearand concise, withoutexcessive or extraneoustextComments provide usefulinformation that elaborates onthe code. These are useful inunderstanding the logic and arenot verbose.Many comments are irrelevant ordo not provide any detail beyondwhat is already obvious in thecode. Excessive length of somecomments obscures the programlogic. All functions havinginformative docstringcommentsProgram docstring is a clearsummary of its purpose.All functions have docstrings thatprovide a complete,unambiguous, description of howit is to be used.Program docstring fairly clearlysummarises its purpose.All functions have docstrings thatprovide a complete and fairlyclear description of how it is tobe used.Most docstrings provide acomplete and fairly cleardescription.Some docstrings provide aninaccurate description, or thereare functions without docstrings. Significant blocks ofprogram logic areclearly explained bycommentsIn-line comments are used toexplain logical blocks of code(e.g. significant loops orconditionals).In-line comments are missing inplaces where they would havebeen useful. Or, in-linecomments are irrelevant orrepeat what is already clear inthe code.本团队核心人员组成主要包括硅谷工程师、BAT一线工程师,精通德英语!我们主要业务范围是代做编程大作业、课程设计等等。我们的方向领域:window编程 数值算法 AI人工智能 金融统计 计量分析 大数据 网络编程 WEB编程 通讯编程 游戏编程多媒体linux 外挂编程 程序API图像处理 嵌入式/单片机 数据库编程 控制台 进程与线程 网络安全 汇编语言 硬件编程 软件设计 工程标准规等。其中代写编程、代写程序、代写留学生程序作业语言或工具包括但不限于以下范围:C/C++/C#代写Java代写IT代写Python代写辅导编程作业Matlab代写Haskell代写Processing代写Linux环境搭建Rust代写Data Structure Assginment 数据结构代写MIPS代写Machine Learning 作业 代写Oracle/SQL/PostgreSQL/Pig 数据库代写/代做/辅导Web开发、网站开发、网站作业ASP.NET网站开发Finance Insurace Statistics统计、回归、迭代Prolog代写Computer Computational method代做因为专业,所以值得信赖。如有需要,请加QQ:99515681 或邮箱:99515681@qq.com 微信:codehelp

上一篇下一篇

猜你喜欢

热点阅读