• Share
  • Email
  • Embed
  • Like
  • Save
  • Private Content
Htdp01
 

Htdp01

on

  • 249 views

 

Statistics

Views

Total Views
249
Views on SlideShare
249
Embed Views
0

Actions

Likes
0
Downloads
0
Comments
0

0 Embeds 0

No embeds

Accessibility

Categories

Upload Details

Uploaded via as Apple Keynote

Usage Rights

© All Rights Reserved

Report content

Flagged as inappropriate Flag as inappropriate
Flag as inappropriate

Select your reason for flagging this presentation as inappropriate.

Cancel
  • Full Name Full Name Comment goes here.
    Are you sure you want to
    Your message goes here
    Processing…
Post Comment
Edit your comment
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n

Htdp01 Htdp01 Presentation 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• (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)
  • 2.2.1• [C]=([F]-32)*5/9• (define (Fahrenheit->Celsius t) (* (- t 32) (/ 5 9)))• convert.ss (teachpack)• (convert-gui Fahrenheit->Celsius)
  • 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) (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)))
  • • .( )• .