# Flashcards for week 3

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

Create ten questions and answers on topics we have explored in the past week (e.g., procedures, including lambda, composition, and sectioning; basic types, including numbers, strings, and lists.).

## 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 questions

What are the seven basic parts of an algorithm?
What is subroutine?
What are the five questions to ask when encountering a data type?
What acronym do we use for those questions?
What is the visual difference between a string, name, symbol, and expression?
What are the 6 Ps? (Don’t list them; describe their purpose.)

### Numbers

What are six different types of numbers in DrRacket?
What is (remainder -11 -4)?
What does truncate do?
What does round do?
What do ceiling and floor do?
What do we expect from (remainder -7 8)?
What is the difference between an exact number and an inexact number?
What are ways to describe numbers and consider when working with them in DrRacket?
What is an example of how to add two numbers in Scheme?
What does (/ 2 4 5) produce?
What kind of number is 2.33333?
What kind of number is 3.0?
What kind of number is 4/5?
What does expt do?
What does the procedure remainder do?
What is the difference between an exact and inexact number?
When using quotient and remainder, what must you remember about signs?
What is the result of (expt 2 4)?
Will this result in an exact or inexact value? (* (sqrt 2) (sqrt 2))
What is the result of (quotient 9 2)?
What is the result of (remainder 9 2)?
How can I find the largest value of 1 2 3 4 5 6 7 8?
What is the result of (denominator 45/46)?
What is the result of (expt 2 "4")?
Do max and min work with all numbers?
What procedures are there to extract “parts” of numbers?
What numbers appear in the one parameter version of (range 10)?

### Image Making

How can you create a solid red square of size 50?
What belongs in the Definitions pane before you can make images?
How do you denote the color blue?
What do beside, above, and overlay do for combining images?
What does a call to rectangle look like?
How do I create a pen for drawing?
How do I define my own color, given the red, green, and blue components?
How do I overlay two images, with an offset?

### Procedures

Describe the structure of a procedure created using lambda.
What does section from the loudhum library do?
What symbol represents function composition?
What exactly is lambda?
What are the three main aspects of a procedure? (Not the documentation.)
What are the six P’s we suse to document procedures?
What is composition?
What are the three ways to write a procedure?
How do I write subtract2 with lambda?
How do I write subtract2 with o?
How do I write subtract2 with section?
Can you have multiple inputs in a single procedure?
If you compose two different procedures, in what order are they applied? For example, for (define f1 (o square add1)), is the square procedure or the add1 procedure applied first?
How can you use procedure sectioning to re-write (define half (/ ? 2)) with a syntax that DrRacket can process?

### Strings

How do you denotate a string?
What does string-append do?
What is the null string?
For the (substring str start end) procedure, what do start and end represent?
What does string->list do?
What does list->string do?
What is (list->string '("alpha" "beta" "gamma"))?
What is the role of backslash (\) character in a string?
What is the result of (string-append "L" "O" "L")?
How do we use the string procedure?
How would you turn a sentence (one string) into a list of words (punctuation may be attached to some words)?
What is the result of (substring "Hello" 1 4)?
What is the result of (string-ref “Hello” 0)?
What is the value of (string-length "a\\b")?
What is the value of (string-length "a\nb\n")?

### Lists

What is a list?
What are some important list operations?
What do the take and drop operations do to a list?
Suppose we have defined fruits with (define fruits (list "apple" "orange" "banana" "pear")). What is (take fruits 2)?
For the same definition, what is (drop fruits 3)?
In Racket, what position (number) is the initial element in a list in?
What should we get from (list-ref '(a b c) 3)?
What should we get from (list-ref '(a b c) 1)?
Is there a limit to how long a list can be in Scheme?
How do you join two lists together?
What is the result of (make-list 5 'LOL)?
How would you extract the last n items of a list in order using the drop procedure?
How can you generate the list of integers from a to b?
What’s an easy way to make lists of identical values?

### Characters

How do I express the letter a?
More generally, how are characters written?
How are characters organized?
How do I ignore case when comparing two letters?
What is the difference between char<? and char-ci<??
What is the difference between Unicode and ASCII?

### Symbols

What is a symbol in Scheme?
What is the purpose of symbols?

### Miscellaneous

What is mapping?
What is the procedure to write text to a file?
What happens when you click “Run” in DrRacket?
How is a list differentiable from a procedure?
Do XML files require a CSS?
How do you add a comment in the definitions pane?
Why is indentation important?
How do I get the previous command I typed in the interactions pane?
What is the keyboard shortcut for “Run”?
What is the result of quoting a number (e.g., (quote 29))?
What are the whitespace characters?
How are parentheses interpreted in Racket?
What happens if you put parentheses around a named value, such as (pi) or (3)?
How can a document use functions from another document?
What is the usual file extension of Racket files?
Is "a" a character?
What are the differences between (+ 2 3) and '(+ 2 3)?
What does Sam believe the most important thing we have learned so far?