Question: SCHEME LANG. Here are Ernie's definitions for complex numbers (define (make-complex-from-rect rl im) (list (sqrt (square rl) (square im))) (atan im rl))) (define (make-complex-from-polar mg
SCHEME LANG.

Here are Ernie's definitions for complex numbers (define (make-complex-from-rect rl im) (list (sqrt (square rl) (square im))) (atan im rl))) (define (make-complex-from-polar mg an) (list mg an) (define (real cx) (*(mag cx) (cos (angle cx)))) (define (imag cx) (mag cx) (sin (angle cx)))) (define (mag cx) (car cx)) (define (angle cx) (cadr cx)) Suppose Ernie makes the following change to his system (define (make-complex-from-polar mg an) (list an mg)) For each of the following choices (which you should treat independently) check if the changes would be sufficient to make the complex number system work properly (Note that work properly means that abstraction barriers are still preserved.) 1. Change make-complex-from-rect to reverse order of arguments to list 2. Change make-complex-from-rect to reverse order of arguments to list, and 3. Chang -omplex-from-rect to reverse order of arguments to list, 4. Chang-omplex-from-rect to reverse order of arguments to list, 5. Nothing needs to change change mag to use cadr change mag to use cadr, and change angle to use car change mag, real to use cadr, and change angle, imag to use car Here are Ernie's definitions for complex numbers (define (make-complex-from-rect rl im) (list (sqrt (square rl) (square im))) (atan im rl))) (define (make-complex-from-polar mg an) (list mg an) (define (real cx) (*(mag cx) (cos (angle cx)))) (define (imag cx) (mag cx) (sin (angle cx)))) (define (mag cx) (car cx)) (define (angle cx) (cadr cx)) Suppose Ernie makes the following change to his system (define (make-complex-from-polar mg an) (list an mg)) For each of the following choices (which you should treat independently) check if the changes would be sufficient to make the complex number system work properly (Note that work properly means that abstraction barriers are still preserved.) 1. Change make-complex-from-rect to reverse order of arguments to list 2. Change make-complex-from-rect to reverse order of arguments to list, and 3. Chang -omplex-from-rect to reverse order of arguments to list, 4. Chang-omplex-from-rect to reverse order of arguments to list, 5. Nothing needs to change change mag to use cadr change mag to use cadr, and change angle to use car change mag, real to use cadr, and change angle, imag to use car
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
