Academic Integrity: tutoring, explanations, and feedback — we don’t complete graded work or submit on a student’s behalf.

Lisp Scheme Write a procedure in Lisp Scheme called charflip that takes a string

ID: 3672930 • Letter: L

Question

Lisp Scheme
Write a procedure in Lisp Scheme called charflip that takes a string as a parameter and returns a copy of this string, flipping the case of every character in an odd position (index 1, 3, 5, etc..).
I suggest that you do this recursively. This means cons, car and cdr will come in handy, as will these functions:
• char-upper-case? • char-downcase • char-upcase • list->string • string->list
Here’s this function in action.
scheme@(guile-user)> (charflip "hatburg") $16 = "hAtBuRg" Lisp Scheme
Write a procedure in Lisp Scheme called charflip that takes a string as a parameter and returns a copy of this string, flipping the case of every character in an odd position (index 1, 3, 5, etc..).
I suggest that you do this recursively. This means cons, car and cdr will come in handy, as will these functions:
• char-upper-case? • char-downcase • char-upcase • list->string • string->list
Here’s this function in action.
scheme@(guile-user)> (charflip "hatburg") $16 = "hAtBuRg" Lisp Scheme
Write a procedure in Lisp Scheme called charflip that takes a string as a parameter and returns a copy of this string, flipping the case of every character in an odd position (index 1, 3, 5, etc..).
I suggest that you do this recursively. This means cons, car and cdr will come in handy, as will these functions:
• char-upper-case? • char-downcase • char-upcase • list->string • string->list
Here’s this function in action.
scheme@(guile-user)> (charflip "hatburg") $16 = "hAtBuRg"

Explanation / Answer

defun stringfun(x)

;case-sensitive comparison

(write(string ="sample lisp"))

(terpri)

"value of x"; This is a string

(-x))

Hire Me For All Your Tutoring Needs
Integrity-first tutoring: clear explanations, guidance, and feedback.
Drop an Email at
drjack9650@gmail.com
Chat Now And Get Quote