daily pastebin goal
24%
SHARE
TWEET

Untitled

a guest May 16th, 2018 75 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. (define (make-term coeff exp)
  2.   (cons coeff exp))
  3.  
  4. (define (term-coeff term) (car term))
  5. (defien (term-exp term) (cdr term))
  6.  
  7. (define (make-polynomial variable . terms)
  8.   (list variable terms)
  9.   (define (poly-variable poly)
  10.     (list-ref poly 0))
  11.   (define (poly-exponent poly)
  12.     (list-ref poly 1))
  13.     (begin
  14.       (display "variable is: ")
  15.       (display variable)
  16.       (newline)
  17.       (display "the terms are: ")
  18.       (display "(")
  19.       (display (poly-variable terms))
  20.       (display variable)
  21.       (display "^")
  22.       (display (poly-exponent terms))
  23.       (display ")")
  24.       (newline)))
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top