Download presentation
Presentation is loading. Please wait.
Published byPrimrose Howard Modified over 9 years ago
1
CS305j Introduction to Computing Structured Programming Case Study 1 Topic 3 Structured Programming Case Study “ Ugly programs are like ugly suspension bridges: they're much more liable to collapse than pretty ones, because the way humans (especially engineer- humans) perceive beauty is intimately related to our ability to process and understand complexity. ” - Eric Steven Raymond, Author of The Cathedral and the Bazaar and maintainer of The Jargon File
2
CS305j Introduction to Computing Structured Programming Case Study 2 What We Will Do Today Do a case study case study –an in depth look at a single problem exploring the possible approaches and solutions.
3
CS305j Introduction to Computing Structured Programming Case Study 3 Desired output /\ \ / /\ /\ +------+ | +------+ |United| |States| +------+ | +------+ /\
4
CS305j Introduction to Computing Structured Programming Case Study 4 Various Solutions Unstructured Structured Structured without redundancy –and what is the big deal about redundancy anyway? –what is wrong with copying and pasting?
5
CS305j Introduction to Computing Structured Programming Case Study 5 It Works If a program works isn’t that all that matters? Aren’t all programs that solve the same problem equivalent? Isn’t one just as good as another?
6
CS305j Introduction to Computing Structured Programming Case Study 6 Bad Solutions No, all working solutions are NOT equal Some solutions are poor: –hard to change –hard for someone else to understand –brittle, easily broken Problem Statement: Create a device to sharpen pencils
7
CS305j Introduction to Computing Structured Programming Case Study 7 Open window (A) and fly kite (B). String (C) lifts small door (D) allowing moths (E) to escape and eat red flannel shirt (F). As weight of shirt becomes less, shoe (G) steps on switch (H) which heats electric iron (I) and burns hole in pants (J). Smoke (K) enters hole in tree (L), smoking out opossum (M) which jumps into basket (N), pulling rope (O) and lifting cage (P), allowing woodpecker (Q) to chew wood from pencil (R), exposing lead. Emergency knife (S) is always handy in case opossum or the woodpecker gets sick and can't work.
Similar presentations
© 2025 SlidePlayer.com. Inc.
All rights reserved.