Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

I am programming in scheme ( define ( sum n ) ( if ( > = n 0 ) ( if ( = n 0

I am programming in scheme
(define (sum n)
(if (>= n 0)
(if (= n 0)
0
(+ n (sum (- n 1))))
0))
(define (ReverseEm elems)
(if (null? elems)
'()
(append (ReverseEm (cdr elems))(list (car elems)))))
(define (nonNegative num)
(if (>= num 0)
num
0))
(define (JustDoIt lst)
(let ((positive-sum (sum (map nonNegative lst))))
(ReverseEm (list positive-sum))))
When I do (JustDoIt '(314602-5)), it says REAL expected, why, how do I fix it?

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

The Database Management Systems

Authors: Patricia Ward, George A Dafoulas

1st Edition

1844804526, 978-1844804528

More Books

Students also viewed these Databases questions

Question

Prepare an ID card of the continent Antarctica?

Answered: 1 week ago

Question

What do you understand by Mendeleev's periodic table

Answered: 1 week ago

Question

Ability to work comfortably in a team environment

Answered: 1 week ago

Question

Exposure to SQL desirable but not required

Answered: 1 week ago