讲解:CO545、LINELEN、Java,Python、c/c++,JavaDatabase|Databas

CO545 Spring Term 2018–19 Assessment 2This assessment is a text processing case study, and a partial implementation is provided in the file a2.erl.You should submit your solutions to Moodle in a single Erlang file by 23:55, Monday 25 February.Types and specsThis assessment uses the type and spec declarations described in the terminal class 4 worksheet.MacrosWe use an Erlang macro to specify the constant line length, LINELEN. When we want to use this we have to write LINELEN.What should the functions do?While the -spec declarations and comments in the file give you some idea of what the functions should do, here’s some more information about some of the definitions that you need to complete.get_word/1 get_word(St) will take the longest word from the beginning of the string St: that is the longest initial string up to the first whitespace character. There is an example in the file.drop_word/1 drop_word(St) drops characters from the string St up to the first whitespace character.drop_wsp/1 drop_wsp(St) drops characters from the string St up to the first non-whitespace character.words/1 words(St) splits tCO545留学生作业代做、代写LINELEN作业、代做Java,Python语言作业、c/c++,Java程序作业代写 he string St into a lost of words.get_line/2 To build a line, take as many words as possible, keeping the total length (including a single inter-word space between adjacent words) below the specified length, which is the second parameter of get_line.drop_line/2 Drop words corresponding to the line got by get_line.lines/1 Repeatedly apply get_line and drop_line to turn a lost of words into a list of lines i.e. a list of list of words.continued over the page …Simon Thompson 10, 11 February 2019Marking schemeMarks are awarded for functional correctness. Up to 10% of the marks will be deducted for solutions which are overly complicated, obscure or difficult to read.While we would encourage you to talk to others about generalities of the work, the work that you submit should be identifiably your own. Please consult the university guidelines on plagiarism for more details.Function Marksget_word/1 10drop_word/1 10drop_wsp/1 5words/1 10get_line/2 10drop_line/2 10lines/1 10check/1 5show_line_right/1 10replicate/2 5print_line_right/1 5show_doc_right/1 5print_doc_right/1 5转自:http://ass.3daixie.com/2019022234825213.html

©著作权归作者所有,转载或内容合作请联系作者
【社区内容提示】社区部分内容疑似由AI辅助生成,浏览时请结合常识与多方信息审慎甄别。
平台声明:文章内容(如有图片或视频亦包括在内)由作者上传并发布,文章内容仅代表作者本人观点,简书系信息发布平台,仅提供信息存储服务。

相关阅读更多精彩内容

  • 每个人都有自己的灵魂,你知道你的灵想要做什么吗?你每次都问过他吗?小时候经常有个声音告诉我回家吧,爱玩的我们...
    简单朱雀阅读 5,314评论 2 4
  • 今日是清明假期的第一天,这边的节日气氛很浓,很多人都返回老家扫墓祭祖了(俗称拜山)。 自从在图书馆办了借书证后,差...
    遇见余白阅读 1,661评论 1 2
  • 该怎么形容现在的自己呢,是恶魔还是天使. 凌晨两点多了,空旷的大房子里一切都在泛滥 像洪水冲破了山头直冲横撞,...
    f6039cb41f18阅读 3,192评论 0 0

友情链接更多精彩内容