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

Below is a question that I have issues with I have code but not working if you c

ID: 3663815 • Letter: B

Question

Below is a question that I have issues with I have code but not working if you could help me to figure it out it would be much appreciated. Below the question is my current code. Not sure how to test it either

Write before-in-list?, which takes a list and two elements of the list. It should return #t if the second argument appears in the list argument before the third argument: > (before-in-list? '(back in the ussr) 'in 'ussr) #T > (before-in-list? '(back in the ussr) 'the 'back) #F

The procedure should also return #f if either of the supposed elements doesn't appear at all.

; Write before-in-list?, which takes a list and two elements of the list. It

; should return #t if the second argument appears in the list argument before the third

; argument: ; ; > (before-in-list? ’(back in the ussr) ’in ’ussr) ; #T

; ; > (before-in-list? ’(back in the ussr) ’the ’back) ; #F

; ; The procedure should also return #f if either of the supposed elements doesn’t appear

; at all.

(define (before-in-list? lst a b)

(cond

((null? lst) #f)

((equal? (car lst) a) (member? b (cdr lst)))

((equal? (car lst) b) #f)

(else (before-in-list? (cdr lst) a b))))

Explanation / Answer

your also is fine, you may apply regrression and broundry value testing

I advise you to write this progeram in some programming langugae

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