1 / 9

Conditionals

Sept 27 th , 2019. Conditionals. Agenda. Preliminaries (8:30-8:35) Quiz (8:35-8:45) Conditionals Discussion (8:45-9:00) Lab Time (9:00-9:45) Wrap-up (9:45-9:50). Preliminaries (8:30-8:35). Peer Support Events? Upcoming Work: Wednesday’s lab write-up due at 10:30pm today

ssinclair
Télécharger la présentation

Conditionals

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. Sept 27th, 2019 Conditionals

  2. Agenda • Preliminaries (8:30-8:35) • Quiz (8:35-8:45) • Conditionals Discussion (8:45-9:00) • Lab Time (9:00-9:45) • Wrap-up (9:45-9:50)

  3. Preliminaries (8:30-8:35) • Peer Support Events? • Upcoming Work: • Wednesday’s lab write-up due at 10:30pm today • Today’s lab write-up due at 10:30pm Monday

  4. Quiz (8:35-8:45)

  5. Conditionals Discussion (8:45-9:00) • Think-pair-share: What do each of these expressions produce? • (if #t “true” “false”) • ”true” • (if #f (/ 1 0) (/ 1 2)) • 1/2 • (+ 1 (if #t 4 5)) • 5

  6. Conditionals Discussion (8:45-9:00) • Think-pair-share: How can we simplify this procedure (define num->str (lambda (num) (if (= num 0) “zero” (if (= num 1) “one” (if (= num 2) “two” …

  7. Conditionals Discussion (8:45-9:00) • (define num->str •   (lambda (num)    (cond [(= num 0) "zero"] •           [(= num 1) "one"] •           [(= num 2) "two"] •           [(= num 3) "three"] •           [else "HUGE"])))

  8. Lab Time (9:00-9:45) • Person closest to the front starts as driver

  9. Wrap-up (9:45-9:50) • Lab write-up: Exercise 3 (send the code for legs procedure and three example uses) • Upcoming Work: • Today’s lab write up due Monday at 10:30pm • Wednesday’s lab write up due today at 10:30pm

More Related