Skip to main content

Flashcards for week 5

Due: 8 p.m. on Wednesday, 20 February 2019

Create ten questions and answers on topics we have explored in the past week (e.g., Boolean values, conditionals, preconditions and postconditions, precondition checking, and testing).

Send your questions and answers to rebelsky@grinnell.edu.

Title your email CSC 151.01 Flashcards for week 5 (YOUR NAME).

Include your questions and answers in the body of the email.


Submitted questions

Here you can find some of the questions and answers that have been submitted so far (at least those that Sam had time to add).

Big picture

What is the difference between a keyword and a procdure?
What keywords have we learned?

Boolean values and Boolean operators

What is the difference between (and real? positive? number) and (and (real? number) (positive? number))?
What is the order of parameters for tally?
What is the order of parameters for filter?
What is the format for and?
How does and work?
What is (and)?
What is the format for or?
How does or work?
What is (or)?
What is the function of the procedure (tally lst pred?)?
What is the function of the procedure (filter pred? lst)?
What does the procedure all do?
What is a predicate?
What is Racket’s custom for naming predicates?
What is the difference between tally and filter?
What does conjoin do?
What is the difference between (regexp-match? regexp str) and (regexp-match-exact? regexp str)?
What is the difference between not and negate?
What is the purpose of conjoin?

Conditionals

What is the format for if?
What does Racket do with an if expression do?
How does a cond expression work?
What is the difference between a cond expression and a when expression?
How can one rewrite (if test consequent alternate) with and and or?

Preconditions and Postconditions

What purpose do preconditions serve?
What are some things to consider when writing a precondition?
What should be in the postconditions section?
How do you verify preconditions in Scheme?
What are husks and kernels?

Testing

What is the purpose of test suites?
What is the difference between a check and a test?
What is the format for the RackUnit check-=?
What is the epsilon parameter in check-=?
How do you make a test case?
Why use a test suite over a test case?
Why do we need to write in the definition pane before testing?
What is the optional message in (check-= expression expected epsilon optional-message)?
(check-= (+ 1.05 0) 1 0.1)
How do you run a test-suite?
How do we define a zero-parameter procedure?
What is the difference between check-equal? and check-=?
What do we expect from: (check-= (+ 2 5) 8 1)?
What do we expect from: (check-= (+ 2 5) 8 0)?
How can you tell if a check succeeded?

Miscellaneous

What is the range of results for (random 10)?
What other P’s might we document apart from the basic 6 P’s?