120 likes | 290 Views
CSC 151 Sept 9 th , 2019. Writing Your Own Procedures. Agenda. Preliminaries (8:30-8:40) Quiz Debrief (8:40-8:55) Procedures (8:55-9:05) Lab Time (9:05-9:45) Wrap-up (9:45-9:50). Preliminaries (8:30-8:40). Peer Support Events
E N D
CSC 151 Sept 9th, 2019 Writing Your Own Procedures
Agenda • Preliminaries (8:30-8:40) • Quiz Debrief (8:40-8:55) • Procedures (8:55-9:05) • Lab Time (9:05-9:45) • Wrap-up (9:45-9:50)
Preliminaries (8:30-8:40) • Peer Support Events • Frisbee tournament: All day Saturday and Sunday at Middle School Fields
Quiz Debrief (8:40-8:55) • Actually out of 9 • Last question was tricky/not something you’d seen, sorry!
Quiz Debrief (8:40-8:55) • Flour: Input • Stir until all dry ingredients are moistened: Subroutine or Repetition • If dough sticks to rolling pin…: Conditional • Dough: Variable • Arrange the cookie dough balls…: Subroutine or Repetition
Quiz Debrief (8:40-8:55) • Why is flour the input (and not dough)? • It isn’t created in the procedure, must be put in • Different cookies are created depending on the flour put in
Quiz Debrief (8:40-8:55) • (* orange (- apple orange banana)) • 27 • Subtraction can take more than two arguments, works left to right (different than (reduce – 1 2 3 4))
Procedures (8:55-9:05) • With your neighbor, try to recall the three different ways to create a procedure that adds 3 to a number
Procedures (8:55-9:05) • Three ways to make a procedure that adds 3 to a number: • (define plus3 (o increment increment increment)) Composition • (define plus3-a (lambda (number) (+ number 3))) Lambda • (define plus3-b (section + 3 <>)) Sectioning
Lab Time (9:05-9:45) • Write up: None! We’ll continue this lab on Wednesday
Wrap-up (9:45-9:50) • Upcoming Work: • Assignment 2 due tomorrow at 10:30pm • Read about pair programming for Wednesday