It there anyone familiar with the language racket ? I\'m having trouble with thi
ID: 3873664 • Letter: I
Question
It there anyone familiar with the language racket ? I'm having trouble with this problem
this is what I was able to come up with but I'm completely at a loss.
Any help is highly appreciated
Explanation / Answer
- Error "No language chosen" is because you didn't choose language. Go to Language tab > Choose Language > Racket Language
- Then try to debug your code
- One solution to this problem is :
(define (power base exponent)
(cond ((= exponent 0) 1)
((even? exponent) (sqr (power base (quotient exponent 2))))
(else (* (power base (- exponent 1)) base))))
Input:
(power 2 3)
Output:
8
Please let me know for further assistance.
Thanks,
Krishna
Related Questions
drjack9650@gmail.com
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.