Presentation is loading. Please wait.

Presentation is loading. Please wait.

Lesson 3.1 Review: audible tri-tone Write a snap script that… Asks the user to enter 3 numbers corresponding to tone values Checks for valid inputs and.

Similar presentations


Presentation on theme: "Lesson 3.1 Review: audible tri-tone Write a snap script that… Asks the user to enter 3 numbers corresponding to tone values Checks for valid inputs and."— Presentation transcript:

1 Lesson 3.1 Review: audible tri-tone Write a snap script that… Asks the user to enter 3 numbers corresponding to tone values Checks for valid inputs and displays an error message for: Anything < 30 (impossible to hear without a subwoofer) Anything > 90 (gives Mr W a migraine) Check for these values and displays an error message Plays a tri-tone (like the old iphone text tone) after all inputs have been entered

2 Lesson 3.2 Abstraction and Friends

3 Today we’re going to cover 4 important topics in computer science: 1.Abstraction 2.Detail removal 3.Generalization 4.Procedural decomposition

4 Abstraction Formal definition: A technique for managing complexity of computer systems by establishing a level of complexity on which a person interacts with the system Informal definition: The ability to effectively use things without needing to understand how they work Examples: Driving a car without knowing how the engine works Asking Mr W to open a jar of jelly without knowing how the muscles in his arm work Abstraction is magic!

5 Abstraction Take a minute to brainstorm a 2-3 things in your daily life that are abstracted, meaning you use them without needing to know how they work An important aspect of abstraction is acceptable complexity. Example: Microwaves, you don’t need to understand how microwaves affect hydrogen molecules, but you do need to know how to use the control panel. The part you need to understand is the interface. Look at your examples again and write out the complex part that has been abstracted out and what the interface is.

6 Detail removal How does gravity work in real life? How did you make gravity work in your project 2? Take a minute to brainstorm 2-3 differences between real gravity and your project 2 gravity. These differences are an example of detail removal

7 Detail removal Formal definition: reducing the complexity of an algorithm or process by focusing on the important parts Informal definition: simplifying an algorithm so that its just good enough for its purpose Think back to our lesson on computer modeling… Models just need to look and feel real, they don’t need to be 100% accurate It’s often impossible to get 100% accuracy

8 Generalization Formal definition: Defining a domain by a set of common characteristics and applying this to a set of elements Informal definition: combining a group of related concepts or processes into a single category Example: Opening a jar of peanut butter or jelly, spreading peanut butter or jelly on bread Take a minute to look over the old labs and find places where there are similar processes

9 Procedural decomposition Formal definition: breaking a complex problem or system into parts that are easier to conceive, understand, program, and maintain Informal definition: breaking a big problem into little pieces This is usually accomplished using the concepts we just defined: abstraction, detail removal, and generalization

10 Food algorithms revisited In small groups, use procedural decomposition to write an algorithm for making a club sandwich Ingredients: bread, chicken, bacon, lettuce, tomato, and mayonnaise All ingredients start out cooked and sliced, but in containers Identify places where you can use abstraction, detail removal, and generalization

11 Food algorithms revisited Write ALL of your names on the top of a SINGLE sheet of paper with your algorithm and examples of abstraction, detail removal, and generalization. Turn the paper into Mr W


Download ppt "Lesson 3.1 Review: audible tri-tone Write a snap script that… Asks the user to enter 3 numbers corresponding to tone values Checks for valid inputs and."

Similar presentations


Ads by Google