40 likes | 49 Views
Two kinds of programs. Some programs are like the draw-my-picture program. They start with ingredients then step-by-step calculate whatever they must then stop. What are some examples of such programs?
E N D
Two kinds of programs • Some programs are like the draw-my-picture program. • They start with ingredients • then step-by-step calculate whatever they must • then stop. • What are some examples of such programs? • Perhaps: make a sandwich; convert Fahrenheit to Celsius; compute the fastest route to Detroit. • What are some examples of programsthat don’t fit this paradigm? • See the next slide for some answers
Today, most computer programs: Are embedded in an environment Interact with that environment Examples include: word processing program spreadsheet video game web browser cruise control for car robot control system Ongoing computational activity
Computational Communities • Today’s computer systems are often: • Composed of many separate pieces • that interact with each other • as well as with the world. • Coordinating the activity among the many entities that make up your program – and their interactions with the world around them – is the second aspect of computer programming.
Example: RestaurantComputational Community • Consider a restaurant as an example program • Key questions to ask yourself: • What is the desired behavior of the program? • E.g., in a restaurant: each customer is seated at a clean table, the order is taken, food is served, etc. • Who are the entities who interact to produce this behavior? • E.g., in a restaurant: wait staff, kitchen staff, manager, etc. • How do these entities work? (What goes inside each entity?) • E.g., wait staff: greet customer, supply menu, take order, etc. • How do these entities interact? • E.g., [details of interaction between waiter and cook, via piece of paper with order]