Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- (define (make-term coeff exp)
- (cons coeff exp))
- (define (term-coeff term) (car term))
- (defien (term-exp term) (cdr term))
- (define (make-polynomial variable . terms)
- (list variable terms)
- (define (poly-variable poly)
- (list-ref poly 0))
- (define (poly-exponent poly)
- (list-ref poly 1))
- (begin
- (display "variable is: ")
- (display variable)
- (newline)
- (display "the terms are: ")
- (display "(")
- (display (poly-variable terms))
- (display variable)
- (display "^")
- (display (poly-exponent terms))
- (display ")")
- (newline)))
Add Comment
Please, Sign In to add comment