Let's Play "What's the Question" Remember each question will be in the form of an answer and you must respond with a question. GOOD LUCK Here are the categories
Scheme Terms
The Design Recipe
Compound Data
And The Answer Is…
Errors
Templates
Scheme Terms The Design Recipe Compound Data And The Answer Is… Errors Templates $100 $100 $100 $100 $100 $100 $200 $200 $200 $200 $200 $200 $300 $300 $300 $300 $300 $300 $400 $400 $400 $400 $400 $400 $500 $500 $500 $500 $500 $500
Syntax is to computer languages as this is to English. $100
What is grammar? $100
cond, else, and define $200
What are keywords? $200
Refers to the meaning of programs. $300
What is semantics? $300
( + x 5 ) is an example of this. $400
What is an expression? $400
Variables that follow the first variable in the header? $500
What are parameters? $500
(define (f x) …) is an example of this. $100
What is a header? $100
Provides the name of the function as well as its input and output data types. $200
What is a contract? $200
The last step of the design recipe. $300
What is running the tests? $300
For a function involving compound data, this is the first step. $400
What is data definition? $400
This step provides an opportunity to think through the computational process of a function. $500
What are examples? $500
make-boa is an example of this. $100
What is a constructor? $100
A selector for the following structure (define-struct dillo (weight alive?)) $200
What is dillo-weight or dillo-alive? ? $200
(cons ‘Bob (cons ‘John empty))) is an example of this. $300
What is a list of symbols? $300
Daily Double
symbol? is an example of this. $400
What is a predicate? $400
These are actually selectors for lists. $500
What are first and rest? $500
(number? (make-posn 2 3 )) $100
What is false? $100
(first (cons 10 (cons 20 (cons 30 empty)))) $200
What is 10? $200
The value of (cond. [(< x 5) ‘RED]. [(> x 5) ‘BLUE] The value of (cond [(< x 5) ‘RED] [(> x 5) ‘BLUE] [else ‘GREEN]) when x = 3 $300
What is ‘RED? $300
Value of Y given the following: (define X 4) (define Y ( * 2 X)) $400
What is 8? $400
(rest (rest (cons 10 (cons 20 (cons 30 empty))))) $500
What is (cons 30 empty)? $500
(define (f) x (+ x 1)) generates this type of error. $100
What is syntax error? $100
empty? (L) generates an error. Give the corrected code. $200
What is (empty? L) ? $200
Type of error in the following: (define (f x) ( / x 0)) $300
What is a run-time error? $300
(draw-solid-disk make-posn (100 100) 50 ‘blue) produces an error (draw-solid-disk make-posn (100 100) 50 ‘blue) produces an error. Describe the cause of this error. $400
What is misplaced parenthesis? $400
A program that never ends has this. $500
What is an infinite loop? $500
Number of cond lines needed in a function that consumes an animal that is either a boa, dillo or ant. $100
What is three? $100
A template for a function consuming this data type should include constructors, selectors and predicates. $200
What is a structure? $200
first and rest appear in templates for this data type. $300
What are lists? $300
The template for this date type is self-referential. $400
What is a list? $400
Used in templates for functions consuming mixed data types, this type of operator determines what type of data is being processed. $500
What is a predicate? $500
Final Game Question Purpose of Function
The purpose of the function, f1 (define (f1 lon). (cond. [(empty The purpose of the function, f1 (define (f1 lon) (cond [(empty? lon) 0] [else (+ (first lon) (f1 (rest lon))]))
What is “To determine the sum of a list of numbers”?
And the winner is…..