Download presentation
Presentation is loading. Please wait.
1
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
2
Scheme Terms
3
The Design Recipe
4
Compound Data
5
And The Answer Is…
6
Errors
7
Templates
8
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
9
Syntax is to computer languages as this is to English.
$100
10
What is grammar? $100
11
cond, else, and define $200
12
What are keywords? $200
13
Refers to the meaning of programs.
$300
14
What is semantics? $300
15
( + x 5 ) is an example of this.
$400
16
What is an expression? $400
17
Variables that follow the first variable in the header?
$500
18
What are parameters? $500
19
(define (f x) …) is an example of this.
$100
20
What is a header? $100
21
Provides the name of the function as well as its input and output data types.
$200
22
What is a contract? $200
23
The last step of the design recipe.
$300
24
What is running the tests?
$300
25
For a function involving compound data, this is the first step.
$400
26
What is data definition?
$400
27
This step provides an opportunity to think through the computational process of a function.
$500
28
What are examples? $500
29
make-boa is an example of this.
$100
30
What is a constructor? $100
31
A selector for the following structure (define-struct dillo (weight alive?))
$200
32
What is dillo-weight or dillo-alive? ?
$200
33
(cons ‘Bob (cons ‘John empty))) is an example of this.
$300
34
What is a list of symbols?
$300
35
Daily Double
36
symbol? is an example of this.
$400
37
What is a predicate? $400
38
These are actually selectors for lists.
$500
39
What are first and rest? $500
40
(number? (make-posn )) $100
41
What is false? $100
42
(first (cons 10 (cons 20 (cons 30 empty))))
$200
43
What is 10? $200
44
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
45
What is ‘RED? $300
46
Value of Y given the following: (define X 4) (define Y ( * 2 X))
$400
47
What is 8? $400
48
(rest (rest (cons 10 (cons 20 (cons 30 empty)))))
$500
49
What is (cons 30 empty)? $500
50
(define (f) x (+ x 1)) generates this type of error.
$100
51
What is syntax error? $100
52
empty? (L) generates an error. Give the corrected code.
$200
53
What is (empty? L) ? $200
54
Type of error in the following: (define (f x) ( / x 0))
$300
55
What is a run-time error?
$300
56
(draw-solid-disk make-posn (100 100) 50 ‘blue) produces an error
(draw-solid-disk make-posn ( ) 50 ‘blue) produces an error. Describe the cause of this error. $400
57
What is misplaced parenthesis?
$400
58
A program that never ends has this.
$500
59
What is an infinite loop?
$500
60
Number of cond lines needed in a function that consumes an animal that is either a boa, dillo or ant. $100
61
What is three? $100
62
A template for a function consuming this data type should include constructors, selectors and predicates. $200
63
What is a structure? $200
64
first and rest appear in templates for this data type.
$300
65
What are lists? $300
66
The template for this date type is self-referential.
$400
67
What is a list? $400
68
Used in templates for functions consuming mixed data types, this type of operator determines what type of data is being processed. $500
69
What is a predicate? $500
70
Final Game Question Purpose of Function
71
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))]))
72
What is “To determine the sum of a list of numbers”?
73
And the winner is…..
Similar presentations
© 2025 SlidePlayer.com. Inc.
All rights reserved.