(define (qux nums) (if (null? nums) 0 (+ (expt (car nums) 2) (qux (cdr nums))))) (qux (1 3 4))
Added by Patrick I.
Close
Step 1
Step 1: The given code seems to be a Scheme function definition for a function called "qux" that takes a list of numbers as input. Show more…
Show all steps
Your feedback will help us improve your experience
Amy Jiang and 78 other AP CS educators are ready to help you.
Ask a new question
Labs
Want to see this concept in action?
Explore this concept interactively to see how it behaves as you change inputs.
Key Concepts
Recommended Videos
Using the sets $A, B, C,$ and $D,$ list the elements in each set. If the set is empty write $\varnothing$. $$\begin{array}{ll}A=\{1,2,3,4,5\} & B=\{4,5,6,7,8,9\} \\C=\{1,3,5,7\} & D=\{2,4,6,8\}\end{array}$$ $$A \cap B$$
Real Numbers
Sets
Using the sets $A, B, C,$ and $D,$ list the elements in each set. If the set is empty write $\varnothing$. $$\begin{array}{ll}A=\{1,2,3,4,5\} & B=\{4,5,6,7,8,9\} \\C=\{1,3,5,7\} & D=\{2,4,6,8\}\end{array}$$ $$A \cap C$$
function find_max(nums) { let max_num = Number.NEGATIVE_INFINITY; // smaller than all other numbers for (let num of nums) { if (num > max_num) { max_num = num; } } return max_num; }
Madhur L.
Recommended Textbooks
Computer Science and Information Technology
Introduction to Programming Using Python
Computer Science - An Overview
Transcript
18,000,000+
Students on Numerade
Trusted by students at 8,000+ universities
Watch the video solution with this free unlock.
EMAIL
PASSWORD