Successfully reported this slideshow.
We use your LinkedIn profile and activity data to personalize ads and to show you more relevant ads. You can change your ad preferences anytime.
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• (define (area-of-disk r)    (* 3.14 (* r r)))• (define (area-of-ring outer inner)    (- (area-of-di...
2.2.1• [C]=([F]-32)*5/9• (define (Fahrenheit->Celsius t)   (* (- t 32) (/ 5 9)))• convert.ss               (teachpack)• (co...
2.4•    - (define (P x)         (+ (x) 10))•    -   (define (f n)         (+ (/ n 3) 2))    -   (f 5 8)
2.5•••••
3        +•        . (Divide And Conquer)
•    .•       !!!
3.2• (define PI 3.14)• (define 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
(define (is-5? n) Is 5 ?                          (= n 5))                 (define (is-between-5-6? n) (5, 6)               ...
•   .(       )•        .
Htdp01
Htdp01
Htdp01
Upcoming SlideShare
Loading in …5
×

Htdp01

307 views

Published on

Published in: Technology, Travel
  • Be the first to comment

  • Be the first to like this

Htdp01

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

×