1 / 4

Two kinds of programs

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?

ahoover
Télécharger la présentation

Two kinds of programs

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. 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

  2. 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

  3. 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.

  4. 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]

More Related