美文网首页
讲解:comp20005、Information Systems

讲解:comp20005、Information Systems

作者: bingernai | 来源:发表于2020-01-10 12:53 被阅读0次

School of Computing and Information Systemscomp20005 Engineering ComputationSemester 1, 2019Assignment 2Learning OutcomesIn this project you will demonstrate your understanding of structures and arrays of structures, and willdevelop a computational solution for a non-trivial problem. You are expected to make extensive use offunctions; and to demonstrate that you have adopted a clear and elegant programming style. You will findit difficult to create a working solution unless you plan your program carefully in advance, and developit incrementally.The MissionYou will again be working with numeric data, this time in connection with rainfall records. All ofthe data files used in this project have been sourced directly from the Bureau of Meteorology web site athttp://www.bom.gov.au/climate/data/, and remain in the format in which they were downloaded.The program that you write will identify historical trends that may exist in the input data, and allowvisualization of the data.Stage 1 – Reading the Data (Marks up to 9/20)In this stage you should read all of the data into internal structures suitable for use in the later stages, andcreate an output representation that provides an overview of the data that was read. Input will come froma comma-separated-values file, with each input line (after the first header line) looking like:IDCJAC0001,086039,2000,01,28.2,YIDCJAC0001,086039,2000,02,34.5,YIDCJAC0001,086039,2000,03,22.5,YIDCJAC0001,086039,2000,05,96.3,YIDCJAC0001,086039,2000,06,42.4,YIDCJAC0001,086039,2000,07,45.1,Yrecording, for example, that the rainfall measured at site 086039 (Flemington Racecourse, in Melbourne)in January 2000 was 28.2 millimeters. The last value in each line is Y or N to indicate whether the datahas been “validated”. To read one line, you should use the format control stringIDCJAC0001,%d,%d,%d,%lf,%cwith suitable receiving variables, and then skip any remaining characters on that line until a newlinecharacter has been consumed. Note that IDCJAC0001 is a fixed string that identifies the type of data, andwill appear in all data files that your program will process.You may assume that the lines in the input are always in ascending-year then ascending-month order,but also need to be aware that there may be missing data lines. For example, there is no data for April2000 in the test file shown above. Missing values are completely typical of sensor-based data, and occurbecause of equipment malfunction, network errors, and so on.A sample of the required output of this stage is:mac: ass2-soln S1, site number 086039, 115 datalines in inputS1, 2000: Jan Feb Mar ... May Jun Jul Aug Sep Oct Nov DecS1, 2001: Jan Feb Mar ... May Jun Jul Aug Sep* Oct Nov* Dec1S1, 2009: Jan Feb* Mar Apr May Jun* Jul Aug Sep Oct Nov Decwhere rainfall-086039-2000-2009.csv is one of the test files linked from the FAQ page; where *indicates a value that has not been validated; and where ... indicates a completely missing value. Fulloutput examples are linked from the FAQ page. Note that the input might start part way through oneyear and end part way through another, so be sure that you handle the first and last year correctly. Theremight also be whole missing years, in which case your program should report every month for that yearas a ... entry.You should be able to get started on the required program for this stage quite quickly, based on yoursolution to the first project (or the sample solution to the first project). And an explicit permission – youmay include this declaration as a global array if you wish to (and if you can see how it would be useful):char *months[] = {, Jan, Feb, Mar, Apr, May, Jun,Jul, Aug, Sep, Oct, Nov, Dec};Stage 2 – The Annual Rainfall Cycle (Marks up to 12/20)Add further functionality to your program so that for each month of the year the average rainfall iscomputed and reported. All months for which at least one data item is available should be listed, andunverified items should also be counted and included in the average. A sample of output lines for thesame test file is:S2, Jan, 10 values, 2000-2009, mean of 23.5mmS2, Feb, 10 values, 2000-2009, mean of 45.5mmS2, Mar, 9 values, 2000-2009, mean of 33.8mmS2, Dec, 10 values, 2000-2009, mean of 48.6mmFull examples are linked from the FAQ page, including showing what should be written if there are norainfall records in one or more of the months. Note that the monthly averages are required again inStage 4, so they should be computed in this stage and then retained, rather than being computed againlater.Stage 3 – Climate Change? (Marks up to 16/20)Ok, now for some trend analysis. Suppose that a sequence of n values hr0 . . . rn?1i is given (in this case,riis the rainfall amount for some specific month across a sequence of years), and we wish to know ifthere is an overall upward or downward trend over the n values. One simple correlation coefficient thatcan be used is Kendall’s τ (pronounced “tau”), which for data already ordered on one aspect (in our case,ordered by time) is computed as:where δ(ri, rj ) is +1 if ri rj ; and is 0 if ri = rj . A τ value of +1.0 indicatesperfect monotonic increase across the sequence of values; a τ value of ?1.0 indicates perfect monotonicdecrease across the sequence of values; and a τ value of 0.0 indicates neither consistent growth norconsistent decrease.In this stage you are to compute twelve τ values from the input data, one τ for each of the months.Each τ value will be computed from the sequence hrii that represents the rainfall for one specific monthacross the span of years available in the data. No τ value should be reported if there are less than twoinstances of that particular month in the input file, see the FAQ for examples.2S3, Jan, 10 values, 2000-2009, tau of -0.11S3, Feb, 10 values, 2000-2009, tau of -0.11S3, Mar, 9 values, 2000-2009, tau of -0.11S3, Dec, 10 values, 2000-2009, tau of 0.36Stage 4 – Let It Rain! (Marks up to 20/20)And now for the fun. Add further functionality to your program so that, for each year number specified asan argument on the command-line, a bar chart is plotted showing the rainfall for that year broken downby months, compared to the average for that month across the years listed in the input data file. Onecomplete graph is to be produced f代做comp20005作业、代写Information Systems作业、代写Python编程作业、代做c/c++,Jor each year that is specified as a program argument, see the exampleslinked from the FAQ page. If no arguments are supplied, no graphs are to be generated. To control theheight of the graph, a vertical scaling factor should be identified by finding the smallest integer such thatthe height of the maximum point plotted in the graph above the axis is at most 24 rows.The example below shows the required output for the year 2003 when using the same sample datafile. To make this graph, the largest point to be plotted is identified as being 71.6 mm of rain, and hencea scale factor of d71.6/24e = 3 is required. Then to get the first bar, January 2003 had a rainfall (in thisdata file) of 9.8 mm and the January average (in this data file) is 23.5 mm, and so with a scale factor ofthree, the January average is plotted in the 8 th cell high (d23.5/3e = 8) and the January actual is plottedfrom the first to the 4 th cells high (d9.8/3e = 4). Note that the graph cells in the row to the right ofeach numbered label v (for example, look at v = 24 in the example) get used for values of r (rainfallamount) in the range v ?scale is marked in the row labeled v = 24. If the value had been exactly 24.0 it would also be plotted in thatcell, but if it was 24.1 it would appear in the row labeled 27. Finally, note that the two digits used in eachbar are the last two digits of the year number that is being plotted.mac: ass2-soln 2003 S4, 2003 max is 71.6, scale is 372 | 03 0369 | 03 03 0366 | 03 03 0363 | 03 03 0360 | 03 03 03 0357 | 03 03 03 03 **** 0354 | 03 03 03 03 0351 | 03 03 03 **** *03* *03*48 | **** 03 03 *03* 03 0345 | 03 03 03 03 0342 | 03 *03* 03 03 0339 | *03* **** 03 03 03 03 03 0336 | **** 03 *03* 03 03 03 03 0333 | 03 03 03 03 03 03 0330 | 03 03 03 03 03 03 0327 | 03 03 03 03 03 03 03 03 0324 | **** 03 03 03 03 03 03 03 03 0321 | 03 03 03 03 03 03 03 03 03 03 0318 | 03 03 03 03 03 03 03 03 03 03 0315 | 03 03 03 03 03 03 03 03 03 03 0312 | 03 03 03 03 03 03 03 03 03 03 03 039 | 03 03 03 03 03 03 03 03 03 03 03 036 | 03 03 03 03 03 03 03 03 03 03 03 033 | 03 03 03 03 03 03 03 03 03 03 03 030 +-----+----+----+----+----+----+----+----+----+----+----+----+Jan Feb Mar Apr May Jun Jul Aug Sep Oct Nov DecIf there is no record of rainfall for a particular month within the year being plotted (or if there isno data for that whole year at all, including cases when the specified year is outside the span of years3included in the data file), plot that month as zero (which means, no marking in the graph), but still plotthe average. If there is no average, because there were no readings at all for that month in the input file,don’t plot the average either.Modifications to the SpecificationThere are bound to be areas where this specification needs clarification or correction. Refer to theFAQ page at http://people.eng.unimelb.edu.au/ammoffat/teaching/20005/ass2/ regularlyfor updates to these instructions. There is already a range of information provided there that you need tobe aware of, with more likely to follow.The Boring Stuff...This project is worth 20% of your final mark. A rubric explaining the marking expectations is linkedfrom the FAQ page, and you should read it carefully.You need to submit your program for assessment; detailed instructions on how to do that are linkedfrom the FAQ page. You can (and should) use submit both early and often – to get used to the wayit works, and also to check that your program compiles correctly on the test server, which has somedifferent characteristics to the lab machines. Failure to follow this simple advice is likely to result intears. Only the last submission that you make before the deadline will be marked.You may discuss your work during your workshop, and with others in the class, but what gets typedinto your program must be individual work, not copied from anyone else. So, do not give hard copyor soft copy of your work to anyone else; do not “lend” your “Uni backup” memory stick to othersfor any reason at all; and do not ask others to give you their programs “just so that I can take a lookand get some ideas, I won’t copy, honest”. The best way to help your friends in this regard is to say avery firm “no” when they ask for a copy of, or to see, your program, pointing out that your “no”, andtheir acceptance of that decision, is the only thing that will preserve your friendship. A sophisticatedprogram that undertakes deep structural analysis of C code identifying regions of similarity will be runover all submissions. Students whose programs are identified as containing significant overlaps will beevaluated for mark penalties of for referral to the Student Center for possible disciplinary action withoutfurther warning. This message is the warning. See https://academicintegrity.unimelb.edu.aufor more information. Note also that solicitation of solutions via posts to online forums, whether or notthere is payment involved, is also taken very seriously. In the past students have had their enrolmentterminated for such behavior.Very Important: The FAQ page contains a link to a program skeleton that you must start with,including an Authorship Declaration that you must “sign” and include at the top of your submittedprogram. Marks will be deducted if you do not include the declaration, or do not sign it, or do notcomply with its expectations.Deadline: Programs not submitted by 10:00am on Monday 27 May will lose penalty marks at therate of two marks per day or part day late. Students seeking extensions for medical or other “outsidemy control” reasons should email ammoffat@unimelb.edu.au as soon as possible after those circumstancesarise. If you attend a GP or other health care professional as a result of illness, be sure to takea Health Professional Report form with you (get it from the Special Consideration section of the StudentPortal), you will need this form to be filled out if your illness develops in to something that laterrequires a Special Consideration application to be lodged. You should scan the HPR form and send it inconnection with any non-Special Consideration assignment extension requests.A sample solution will be linked from the FAQ page by June 4, and it is hoped that marks will beavailable on the LMS by the evening of Tuesday 11 June.c The University of Melbourne, 2019. Prepared by Alistair Moffat, 4转自:http://www.7daixie.com/2019052031703215.html

相关文章

网友评论

      本文标题:讲解:comp20005、Information Systems

      本文链接:https://www.haomeiwen.com/subject/tmvpactx.html