代写CSI2120作业、代做Programming Paradigms作业、代写Java实验作业、Python/c++程序作业代做代写Python编程|代写R

Assignment 3CSI2120 Programming ParadigmsWinter 2019Due on April 5th before 11:00 pm in Virtual Campus6 marksThere are [10 points] in this assignment. The assignment is worth 6% of your final mark.All code must be submitted in a scm file. Screenshots, files in a format of a word editor, pdfs,handwritten solutions, etc. will not be marked and receive an automatic 0.Question 1. [1 point]Use the built-in function map to replace every number by its reciprocal value in the list. Define a global1over and use 0 as the reciprocal value for 0, i.e., 0 = 1/0.(1over (0 2 3 4 12 0 0 1 0)) (0 1/2 1/3 1/4 1/12 0 0 1 0))Question 2. [2 points]Implement Newton-Rhapsons method for root finding of function in one dimension. Newton-Rhapsonis defined by the iteration ;�where is the current estimate of the root, � is the function evaluated at�lobal definition of the function must take threearguments, the current estimate of the root, the function and the derivative of the function, i.e.,; (newtonRhap x f fx)Your routine must stop the iterations if the change in the solution is less than a tolerance. For thispurpose use a global define, i.e.,(define TOL 1e-6)See next page for examples. CSI 2120 page 2_________________________________________________________________________________________________Examples: (newtonRhap 0.1 sin cos) 0(newtonRhap 2.0 (lambda (x) (- (* x x) x 6)) (lambda (x) (- (* 2 x) 1))) 3.0(newtonRhap -20.0 (lambda (x) (- (* x x) x 6)) (lambda (x) (- (* 2 x) 1))) -2.000000000000118Question 3. [3 points]Implement a routine p_cos which calculates the cosine of an angle in radians. Use the followingproduct approximation of cosine�Use as many terms until the change with the next term is less than a tolerance. For this purpose useagain the global define,(define TOL 1e-6)Examples:(p_cos 0)1(p_cos (/ pi 2)) 0.0You are allowed extra global helper functions. CSI 2120 page 3_________________________________________________________________________________________________Question 4. [5 points]You are not allowed to use any of the built-in string processing function for this question. You canassume that all lists only contain characters.a) Write a predicate separator? that returns true if a character is a space, tab or newline andfalse otherwise. In Scheme this characters are written #space, # ab and # ewlinerespectively. The built-in predicate char=? compares two characters for equality.Example:(separator #space) #t(separator #) #fb) Write a function cpy that copies all characters from an input list into an output list until aseparator is encountered.(cpy (#H #e #l #l #o #space #W #o # #l #d)) (#H #e #l #l #o)c) Write a function drop that removes all characters from an input list until a separator isencountered and returns the remaining list.(drop (#H #e #l #l #o # ewline #W #o # #l #d)) (#W #o # #l #d)d) Write a predicate same? that compares two list of characters and return true if the characters inthe first input list up to a separator are the same as in the second list.(same (#H #e #l #l #o # ab #W #o # #l #d) (#H #e #l #l #o)) #t(same (#H #e #l #l #o #space #W #o # #l #d) (#W #o # #l #d)) #fcontinued on next page. CSI 2120 page 4_________________________________________________________________________________________________e) Write a function replace that replaces a list of characters in the input list between separators withanother set of characters.(replace(#a #space # #i # #d #space #e #a # #s #space#a #space # #o #m #a # #o)‘(#a)‘(# #h #e)) (# #h #e #space # #i # #d #space #e #a # #s#space # #h #e #space # #o #m #a # #o)Or more readable:(list->string (replace (string->list a bird eats a tomato)(string->list a) (string->list the))) the bird eats the tomato 本团队核心人员组成主要包括硅谷工程师、BAT一线工程师,精通德英语!我们主要业务范围是代做编程大作业、课程设计等等。我们的方向领域:window编程 数值算法 AI人工智能 金融统计 计量分析 大数据 网络编程 WEB编程 通讯编程 游戏编程多媒体linux 外挂编程 程序API图像处理 嵌入式/单片机 数据库编程 控制台 进程与线程 网络安全 汇编语言 硬件编程 软件设计 工程标准规等。其中代写编程、代写程序、代写留学生程序作业语言或工具包括但不限于以下范围:C/C++/C#代写Java代写IT代写Python代写辅导编程作业Matlab代写Haskell代写Processing代写Linux环境搭建Rust代写Data Structure Assginment 数据结构代写MIPS代写Machine Learning 作业 代写Oracle/SQL/PostgreSQL/Pig 数据库代写/代做/辅导Web开发、网站开发、网站作业ASP.NET网站开发Finance Insurace Statistics统计、回归、迭代Prolog代写Computer Computational method代做因为专业,所以值得信赖。如有需要,请加QQ:99515681 或邮箱:[email protected] 微信:codehelp

你可能感兴趣的:(代写CSI2120作业、代做Programming Paradigms作业、代写Java实验作业、Python/c++程序作业代做代写Python编程|代写R)