What are the values for the scheme expressions? (cons 1 2) (cons 1 (cons 2 '())) (list-ref '(a b c d e f g) 3) (eq? 'James 'James) (length '(3 1 2 3 7)) (equal? '(1 5 3) '(1 5 3)) (member 2 (quote (1 7 3))) (member 2 '(3 1 2 3 7)) (list '1 '2 '3 '5) (car '(5 3 1 2 3)) (cdr '(5 3 1 2 3)) (list '(1 2 3) '(5 6)) (append '(1 2 3) '(5 6)) (member 5 '(3 7 5 6)) (if (> 7 0) (+ 4 5) (- 8 3)) (remainder 103 25) (quotient 103 25) (expt 3 2) (null? '()) ((lambda (x y) (+ (* 2 x) y)) 3 7) Write the expression for the third element in the list '(3 1 8 9 2)
Added by Maureen M.
Close
Step 1
(cons 1 2) - This expression creates a pair with 1 as the first element and 2 as the second element. The result is (1 . 2). Show more…
Show all steps
Your feedback will help us improve your experience
Jennifer Stoner and 69 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
The following grammar defines the syntax of a small imperative C-like language. Give a complete formal semantics to this language. prog ::= stmt_list :: stmt_list ::= stmt ; stmt_list / stmt stmt ::= int id ptr id stmt ::= id = expr stmt ::= * id = expr stmt ::= r_value := integer stmt ::= id := &id stmt ::= * id expr ::= expr r_value r_value ::= r_value r_value
Supreeta N.
Let U = {1, 2, 3, 4, 5, 6, 7, 8, 9, 10}, A = {1, 3, 5, 7, 9}, B = {2, 4, 6, 8, 10}, and C = {1, 2, 4, 5, 9, 10}. List the elements of each set. (Enter your answers using roster notation. Enter EMPTY or ∅ for the empty set.) (a) AC (b) B ∪ C (c) C ∪ CC
Pritesh R.
S is a set of arithmetic expressions recursively defined as follows: Base case: Every variable from the set { a, b, c, d, e, f } is in S. Recursive rules: If x ∈ S and y ∈ S, then: 1. (x + y) ∈ S 2. x · y ∈ S Indicate which expressions are in S.
Adi S.
Recommended Textbooks
Computer Science and Information Technology
Introduction to Programming Using Python
Computer Science - An Overview
18,000,000+
Students on Numerade
Trusted by students at 8,000+ universities
Watch the video solution with this free unlock.
EMAIL
PASSWORD