DIT027-SampleExam

DIT027-SampleExam

ID:40058661

大小:84.58 KB

页数:9页

时间:2019-07-18

DIT027-SampleExam_第1页
DIT027-SampleExam_第2页
DIT027-SampleExam_第3页
DIT027-SampleExam_第4页
DIT027-SampleExam_第5页
资源描述:

《DIT027-SampleExam》由会员上传分享,免费在线阅读,更多相关内容在学术论文-天天文库

1、EXAMDistributedFault-tolerantProgrammingDIT027Day:SampleExamTime:??-??Place:N/A•Responsible:HansSvensson•Result:Notapplicable•Aids:None•Grade:Thereare6assignments(with15+24+16+15+25+5=100points);atotalofatleast50pointsisapass(G)andatotalofatleast75pointsisapassw.distinction(VG).Pleas

2、ereadthefollowingguidelinescarefully:•Pleasereadthroughallassignmentsbeforestartworkingontheanswers•AnswersshouldbegiveninEnglish•Begineachassignmentonanewsheet•WriteyouranonymousIDoneachsheet•Writeclearly;unreadable==wrong!•Fullmarksaregiventosolutionsthatareshort,elegant,andcorrect

3、•Lessmarksaregiventounnecessarilycomplicatedorunstructuredsolutions•Don'tforgettowritecommentswithyourcode•YouareallowedtousestandardErlangfunctionsandlibraries,ifnothingisexplicitlymentionedintheproblemdescription•Theexactsyntaxisnotcrucial,youwillnotbepunishedformissingforexampleap

4、arenthesisoracomma.GoodLuck!Problem1–Patternmatching(total15p)Inthisassignmentyouaregivenfivepatternmatchingexpressions.Ifmatchingsucceeds,whatarethevaluesoftheboundvariables?Ifmatchingdoesnotsucceed,explainwhy.(3p)QuestionA{A,B}={12,[1,2,3]}.(3p)QuestionB[X,Y,stop

5、Z]=[1

6、[5

7、[stop,3,4

8、]]].(3p)QuestionC{{_,X},{_,Y}}={{5,1},{1,5}}.(3p)QuestionD{{A,B},[A]}={{1,2},[2]}.(3p)QuestionE{person,Gender,Name,24}={person,female,”Eva”,24}.Problem2–Understandingsequentialcode(total24p)Inthisassignmentyouaregiventhecodeofthemoduleexam(listedbelow).Firstly,youhavetoexplaintheresu

9、ltofevaluatingthefollowingexpressions:(3p)QuestionAexam:f1(1,[2,3,1,4]).(3p)QuestionBexam:f1(1,[1,2,3,1,4]).(3p)QuestionCexam:f1(6,[1,aap,2,1]).(3p)QuestionDexam:f2([aap,noot,mies],[1,2,3]).(3p)QuestionEexam:f2([[1,2],[2,3]],[1,2]).(3p)QuestionFexam:f2([1,2,3],[aap]).Secondly,youhave

10、toexplaintheerrormessageproducedwhenevaluatingthefollowingexpressions:(3p)QuestionGexam:f1(3,[1,2

11、3]).**exceptionerror:nofunctionclausematchingexam:f1(3,3)infunctionexam:f1/2(3p)QuestionHexam:f2([1,2,3],[3,2,1,0]).**exceptionerror:nofunctionclausematchingexam:f2([],[0])infunctionexam

12、:f2/2Theexam

当前文档最多预览五页,下载文档查看全文

此文档下载收益归作者所有

当前文档最多预览五页,下载文档查看全文
温馨提示:
1. 部分包含数学公式或PPT动画的文件,查看预览时可能会显示错乱或异常,文件下载后无此问题,请放心下载。
2. 本文档由用户上传,版权归属用户,天天文库负责整理代发布。如果您对本文档版权有争议请及时联系客服。
3. 下载前请仔细阅读文档内容,确认文档内容符合您的需求后进行下载,若出现内容与标题不符可向本站投诉处理。
4. 下载文档时可能由于网络波动等原因无法下载或下载错误,付费完成后未能成功下载的用户请联系客服处理。
相关文章
更多
相关标签