PFTD APT-3 due Tuesday, September 22 Assignment 2 due September 29 - - PowerPoint PPT Presentation

pftd
SMART_READER_LITE
LIVE PREVIEW

PFTD APT-3 due Tuesday, September 22 Assignment 2 due September 29 - - PowerPoint PPT Presentation

J is for Compsci 101 Pancakes, While loops, Parallel Lists JSON Live Lecture Format for data transmitted across the web Susan Rodger JPEG September 17, 2020 Image format based on lossy compression Jacquard Loom


slide-1
SLIDE 1

Compsci 101 Pancakes, While loops, Parallel Lists Live Lecture

9/17/2020 Compsci 101, Fall 2020 1

Susan Rodger September 17, 2020

J is for …

  • JSON
  • Format for data

transmitted across the web

  • JPEG
  • Image format based on

lossy compression

  • Jacquard Loom
  • 1804 "automated" loom

9/17/2020 Compsci 101, Fall 2020 2

Announcements

  • APT-3 due Tuesday, September 22
  • Assignment 2 due September 29
  • Last Chance for Accommodations letter
  • Email to Yesenia at yvelasco@cs.duke.edu
  • Do not email Prof. Rodger!
  • No Videos, RQ’s next week
  • Exam 1 Thursday 9/24
  • Pick a time and take it that day
  • Fixed amount of time to take it
  • APT Quiz 1 9/25-9/28

9/17/2020 Compsci 101, Fall 2020 3

PFTD

  • Files and Data
  • Pancake APT
  • While loops and Collatz sequence
  • Parallel lists

9/17/2020 Compsci 101, Fall 2020 4

slide-2
SLIDE 2

WOTO-1 Files http://bit.ly/101f20-0917-1

  • In your groups:
  • Come to a consensus

9/17/2020 Compsci 101, Fall 2020 6

Pancakes!

9/17/2020 Compsci 101, Fall 2020 7

APT Pancake

  • How do you solve this (or any) problem?
  • 7 Steps!
  • Some APTs are hard problems to solve (step 1-4)
  • Translating to code easy
  • Some APTs have easy-to-see algorithms (step 5)
  • Translating to code is hard

9/17/2020 Compsci 101, Fall 2020 8 compsci 101, fall 2017 9

slide-3
SLIDE 3

compsci 101, fall 2017 10

WOTO-2 Pancakes http://bit.ly/101f20-0917-2

  • In your groups:
  • Come to a consensus

9/17/2020 Compsci 101, Fall 2020 14

Let’s code it up!

9/17/2020 Compsci 101, Fall 2020 25

Review: While Loops

  • Don't know: how many times loop executes
  • a priori knowledge, we'll know afterword
  • Do know: condition that should be true after loop
  • Its negation is the expression for

BOOL_CONDITION (loop guard)

9/17/2020 Compsci 101, Fall 2020 28

while BOOL_CONDITION: LOOP_BODY # modify variables, affect expression

slide-4
SLIDE 4

WOTO-3 Collatz and While http://bit.ly/101f20-0917-3

  • In your groups:
  • Come to a consensus

9/17/2020 Compsci 101, Fall 2020 29

Genesis Bond ‘16

  • Facebook Engineer
  • Struggled at Duke
  • 5 years
  • Dismissed 1 semester due

to grades

  • Revature
  • Trainer Full Stack

Development

  • http://bit.ly/dukebond

9/17/2020 Compsci 101, Fall 2020 30

Poor preparation promotes poor performance. In anything you do, your preparation will show.

Parallel Lists Review

  • We will use parallel lists to track data
  • Each word is stored in a list named words
  • Word’s count is stored in a list named counts
  • # occurrences of words[k] is in counts[k]

["apple", "fox", "vacuum", "lime"] [5,2,25,15]

  • What happens when we read a word?

9/17/2020 Compsci 101, Fall 2020 31

WOTO-4 File Frequency http://bit.ly/101f20-0917-4

  • In your groups:
  • Come to a consensus

9/17/2020 Compsci 101, Fall 2020 32