Guest User

Untitled

a guest
May 16th, 2018
129
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Scheme 0.52 KB | None | 0 0
  1. (define (make-term x y)
  2.   (list x y))
  3.  
  4. (define (make-polynomial variable . terms)
  5.   (list variable terms)
  6.   (define (poly-variable poly)
  7.     (list-ref poly 0))
  8.   (define (poly-exponent poly)
  9.     (list-ref poly 1))
  10.     (begin
  11.       (display "variable is: ")
  12.       (display variable)
  13.       (newline)
  14.       (display "the terms are: ")
  15.       (display "(")
  16.       (display (poly-variable terms))
  17.       (display variable)
  18.       (display "^")
  19.       (display (poly-exponent terms))
  20.       (display ")")
  21.       (newline)))
Add Comment
Please, Sign In to add comment