讲解: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

你可能感兴趣的:(讲解:CO545、LINELEN、Java,Python、c/c++,JavaDatabase|Databas)