Like this presentation? Why not share!

# Htdp01

## on Jun 25, 2011

• 249 views

### Views

Total Views
249
Views on SlideShare
249
Embed Views
0

Likes
0
0
0

No embeds

### Report content

• Comment goes here.
Are you sure you want to
• \n
• \n
• \n
• \n
• \n
• \n
• \n
• \n
• \n
• \n
• \n
• \n
• \n
• \n
• \n
• \n
• \n
• \n
• \n
• \n
• \n

## Htdp01Presentation Transcript

• How To Design Programs
• ••••
• ••••
• •• (generative recusion)• (accumulation)• (history sensitivity)
• Scheme•••• .
• 2 , ,•• (+ 5 5), (- 5 5), (* 3 4), (/ 8 12)• (* (+ 2 2) (/ (* (+ 3 5) (/ 30 10)) 2))
• • = 3.14 * r^2• (deﬁne (area-of-disk r) (* 3.14 (* r r)))• (deﬁne (area-of-ring outer inner) (- (area-of-disk outer) (area-of-disk inner)))• (area-of-ring 5 3)
• 2.2.1• [C]=([F]-32)*5/9• (deﬁne (Fahrenheit->Celsius t) (* (- t 32) (/ 5 9)))• convert.ss (teachpack)• (convert-gui Fahrenheit->Celsius)
• 2.4• - (deﬁne (P x) (+ (x) 10))• - (deﬁne (f n) (+ (/ n 3) 2)) - (f 5 8)
• 2.5•••••
• 3 +• . (Divide And Conquer)
• • .• !!!
• 3.2• (deﬁne PI 3.14)• (deﬁne PI 3.14159)
• • .
• 4 . x=y (= x y) x<y (< x y) x>y (> x y)
• (and (= x y) (< y z))(or (= x y) (< y z)) (not (= x y)) true, false
• (deﬁne (is-5? n) Is 5 ? (= n 5)) (deﬁne (is-between-5-6? n) (5, 6) (and (< 5 n) (< n 6)))(5, 6) or (deﬁne (is-between-5-6-or-over-10? n)over 10? (or (is-between-5-6? n) (>= n 10)))
• • .( )• .