讲解:Java:INFO1105 Submission HistoryJava、Java

代写Java作业,实现题目要求的SubmissionHistory接口,并通过测试。Specification of the codingDescriptionYou will write the code for a class Assignment which implements the SubmissionHistory interface. This interface describes a system for keeping track of student assignment submissions.The SubmissionHistory interfaceSubmissionHistory objects allow you to keep track of Submission objects. The SubmissionHistory interface has the following methods:1234567891011121314151617181920// Find the highest grade of any submission for a given studentpublic Integer getBestGrade(String unikey);// The most recent submission for a given studentpublic Submission getSubmissionFinal(String unikey);// The most recent submission for a given student, prior to a given timepublic Submission getSubmissionBefore(String unikey, Date deadline);// Add a new submission (can assume submissions from one student have different times)public Submission add(String unikey, Date timestamp, Integer grade);// Remove a submission (can assume submissions from one student have different times)public void remove(Submission submission);// Get all the students who have the highest gradepublic List

listTopStudents();// Get all the students whose most recent submission has lower grade than their best submissionpublic List listRegressions();& For all of the interface methods, if any of the arguments passed to the method are null, then you should throw new IllegalArgumentException();The full skeleton code for the assignment (with more detailed comments than those given here) is available for download on the resources section of Ed, and is also listed in the appendix.Think carefully about which data structure(s) are most suitable. A simple solution can work correctly (and get reasonable marks) but for efficiency, you may find it useful to store data in more than one data structure or to nest structures.To achieve maximum marks, your solution should be efficient. All methods should run in sub-linear time (i.e. better than O(n), where n is the number of submissions. You can still get good marks (i.e. a credit) for simpler, less efficient solutions (provided that they are correct, and are correctly analyzed).Exceptions:listRegressions should be better than O(n^2) timelistTopStudents should be better than O(n) time, with the assumption that the number of students being returned is sub-linear.Submission objectsEach Submission object has a unikey (String), a timestamp (java.util.Date), and a grade (Integer). You may assume that Submission objects are immutable. That means that once an submission has been added, it cannot be modified (but it could be removed.) You may assume that no student will have multiple submissions with the same timestamp. You may assume that any Submission object has non-null values for its three fields.ExampleSuppose we added the following submissions: 21234567891011121314151617181920212223242526272829303132333435363738SimpleDateFormat df = new SimpleDateFormat(&"yyyy/MM/dd HH:mm:ss&");SubmissionHistory history = new SubmissionHistory ();history.add(&"aaaa1234&", df.parse(&"2016/09/03 09:00:00&"), 66); //submission Ahistory.add(&"aaaa1234&", df.parse(&"2016/09/03 16:00:00&"), 86); //submission Bhistory.add(&"cccc1234&", df.parse(&"2016/09/03 16:00:00&"), 73); //submission Chistory.add(&"aaaa1234&", df.parse(&"2016/09/03 18:00:00&"), 40Java代写:INFO1105 Submission History代写Java编程、Java编程代写); //submission D// This will return an Integer corresponding to the number 86Integer example1 = history.getBestGrade(&"aaaa1234&");// This will return nullInteger example2 = history.getBestGrade(&"zzzz1234&");// This will throw new IllegalArgumentException();Integer example3 = history.getBestGrade(null);// This will return a Submission corresponding to submission DSubmission example4 = history.getSubmissionFinal(&"aaaa1234&");// This will return a Submission corresponding to submission CSubmission example5 = history.getSubmissionFinal(&"cccc1234&");// This will return a Submission corresponding to submission ASubmission example6 = history.getSubmissionBefore(&"aaaa1234&", df.parse(&"2016/09/03 13:00:00&"));// This will return nullSubmission example7 = history.getSubmissionBefore(&"cccc1234&", df.parse(&"2016/09/03 13:00:00&")); // This will return a list containing only &" aaaa1234 &"// because that students final submission had grade 40, but their best was 86List example8 = history.listRegressions();// This will return a list containing only &" aaaa1234 &"// because that was the only student with the highest gradeList example9 = history.listTopStudents();// If we added another student with the same highest mark, they would both be returned// If we instead removed submission B, then &"cccc1234&" would become the top student& MarkingCode automarkingPart of the marking of your code will be done automatically on Ed. You are encouraged to submit early and often - there is no penalty for making multiple submissions.There will be some visible tests to help you verify that your solution is configured correctly. The remaining test cases will be invisible until after the submission deadline. Test your code carefully to ensure that your solution works correctly. The score on this component will be based on the number of tests passed. If you pass every visible test, you will get at least half of the available marks.Code hand markingPart of the marking of your code will be done by hand. We will grade your code on its readability and overall quality. Your code should be well laid out, with appropriate use of whitespace. Comments should be used where it makes your code easier to understand. Variables and methods should be named appropriately. If appropriate, helper methods should be used to avoid duplicating code, and to make any very complex methods easier to understand.To gain half the marks for this component, your code needs to be understandable without great effort by a reader. Three-quarters of the marks for this component would be awarded for code where, in addition, the design makes some of the methods efficient, and where the structures used are adequately documented in the code itself, and also you have written a set of tests (besides those we provided) that check for the main aspects of correctness of several of the public methods. To get full marks, your design needs to make every method efficient, and it must still be easy to understand, and also you have written a very thorough set of tests (besides those we provided) that check for correctness of all the public methods.Note that if you have a complicated efficient design, and it is not easy to understand, then you will get less than half the marks.ReportYou should write a brief report (please try to keep it under 1 page). The report should include the following:A high level overview of your implementation (one paragraph, or bullet points.)For each data structure used, state what you used it for (one paragraph each, or bullet points.)List each method from the description, stating the running time in big-Oh notation, and giving a brief justification (for example, a justification could say how often various methods of the underlying data structure are called, and what is the big-Oh cost of each call).An easy-to-read report that gives correct running times for the methods, with reasonable justification, will gain at least half the marks for this component. To gain three-quarters of the marks on this component, you should also have a design where several of the methods are efficient. To gain full marks for this component, you should also have a design where every method is efficient.Note that if you have a complicated design, and do not analyse its methods correctly, then you will get less than half the marks.ReportYou should write a report (please try to keep it under 3 pages). The report should include the following:A high level overview of your implementation (one paragraph, or bullet points.)For each data structure used, state what you used it for and why (one paragraph each, or bullet points.)List each method from the description, stating the running time in big-Oh notation, and giving a brief justification (for example, a justification could say how often various methods of the underlying data structure are called, and what is the big-Oh cost of each call).A discussion that compares your design to an alternative design thast you considered, and explains the advantages and disadvantages of each of these two approaches. (1-2 pages)The first three aspects will be scored out of 30, using the same scheme as for the undergraduate students. That is: An easy-to-read report that gives correct running times for the methods, with reasonable justification, will gain at least half the marks for this component. To gain three-quarters of the marks on this component, you should also have a design where several of the methods are efficient. To gain full marks for this component, you should also have a design where every method is efficient. Note that if you have a complicated design, and do not analyse its methods correctly, then you will get less than half the marks.The fourth aspect (the discussion of the comparison with an alternative design) will be scored out of 10. To get half the marks, you need to present an alternative design that could work correctly, and identify one substantial advantage of the design you actually coded. For three-quarters of this aspect, you need to also identify one valid disadvantage of the design you coded. For full marks, you need a reasonable and balanced discussion that shows a good understanding of the alternatives and their implications.转自:http://ass.3daixie.com/2019012256014374.html

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

推荐阅读更多精彩内容

  • By clicking to agree to this Schedule 2, which is hereby ...
    qaz0622阅读 1,440评论 0 2
  • Chapter 1 In the year 1878, I took my degree of Doctor of...
    foxgti阅读 3,667评论 0 6
  • Xcode8 正式版已经发布,去除了对iOS7支持,使用iOS7真机调试的时候会出现下面所示的情况。 Xcode8...
    Tasselx阅读 1,358评论 1 5
  • 烟雾缭绕的乡间, ​是一层层迷茫的想念。 ​外边人想家, ​里边人想人。 ​风和雨还需再配合下, ​眼前的人还太远...
    宇川阅读 152评论 0 0
  • 没经历过春运的人可能感触不大 作为一个亲身经历过两次春运的人,看完真的想回家了。 一 18年,在浙江的的一个小县城...
    诚呈阅读 827评论 0 3