


Study with the several resources on Docsity
Earn points by helping other students or get them with a premium plan
Prepare for your exams
Study with the several resources on Docsity
Earn points to download
Earn points by helping other students or get them with a premium plan
A list of programming problems in scheme, a functional programming language, along with their solutions. The problems cover various topics such as absolute value, summation, computing e, recursion, string manipulation, and euclid’s algorithm. The solutions are provided with explanations and scheme code.
Typology: Slides
1 / 4
This page cannot be seen from the preview
Don't miss anything!



Evaluate each expression in order and return the value of the last expression.
(abs 5) ;Value: 5 (abs 5) ;Value: 5
(define abs (lambda (val)
(define sumton (lambda (n)
Alter the procedure to sum the squares of the numbers.
(pad "yay" 0) ;Value: "yay" (pad "yay" 1) ;Value: "yay " (pad "yay" 3) ;Value: "yay "
(define pad
(gcd 206 40) ;Value: 2
(define gcd (lambda (a b)
(define (baz) 5)
bar
baz
(bar)
(baz)
(let ((a 3) (b 5)) (+ a b))
(let ((+ ) ( +)) (+ 3 (* 4 5)))
(define m 3) (let ((m (+ m 1))) (+ m 1))
(define n 4) (let ((n 12) (o (+ n 2))) (* n o))