You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
; excercise 1.3
; Define procedure that takes three numbers as arguments and returns
; the sum of the squares of the two larger numbers
(define (sum-larger-square a b c)
(cond ((and (< a b) (< a c)) (+ (* b b) (* c c)))
((and (< b a) (< b c)) (+ (* a a) (* c c)))
(else (+ (* a a) (* b b)))))
(sum-larger-square 5 5 6)
50
so, the right answer is :
(define (sum-larger-square a b c)
(cond ((and (<= a b) (<= a c)) (+ (* b b) (* c c)))
((and (<= b a) (<= b c)) (+ (* a a) (* c c)))
(else (+ (* a a) (* b b)))))
(sum-larger-square 5 5 6)
61
The text was updated successfully, but these errors were encountered:
; excercise 1.3
; Define procedure that takes three numbers as arguments and returns
; the sum of the squares of the two larger numbers
(define (sum-larger-square a b c)
(cond ((and (< a b) (< a c)) (+ (* b b) (* c c)))
((and (< b a) (< b c)) (+ (* a a) (* c c)))
(else (+ (* a a) (* b b)))))
(sum-larger-square 5 5 6)
50
so, the right answer is :
(define (sum-larger-square a b c)
(cond ((and (<= a b) (<= a c)) (+ (* b b) (* c c)))
((and (<= b a) (<= b c)) (+ (* a a) (* c c)))
(else (+ (* a a) (* b b)))))
(sum-larger-square 5 5 6)
61
The text was updated successfully, but these errors were encountered: