a problem (procedure) and then systema<cally break the problem down into sub problems (sub procedures). Procedures, also known as rou<nes, subrou<nes, methods, or func<ons simply contain a series of computa<onal steps to be carried out. Issues?
over <me communi<es can become segregated based on various prejudices. 1. Break the problem down into one dimension; a street ini<ally populated with equal probability either black ‘B’, white ‘W’ or empty ‘ ‘ houses. 2. We then allow the system to evolve by randomly selec<ng houses and applying a simple condi<on: If the house is surrounded on both sides by a house different to itself, it will decide to move to an empty loca<on in the street where this condi<on is not sa<sfied. In the unlikely event that a suitable loca<on cannot be found aRer a designated number of aSempts, the house will leave the street.
type of house that plays by different rules, then see how the simula:on differs? Consider a nomad type house (label ‘N’) which does not care about its neighbors. However, it remembers how long it has been in one loca:on, and if longer than a specified threshold it moves to a new loca:on. How must we modify the original (procedural) program in order to account for these new rules?
as a collec<on of interac<ng objects, as opposed to the procedural model, in which a program is seen as a list of func+ons to perform. The aim of object-‐oriented programming is to try to increase the flexibility and maintainability of programs. Data before ac+on.
as objects that have data fields (proper+es that describe the object) and associated procedures known as methods. Objects, which are instances of classes, are used to interact with one another to design applica<ons and computer programs. Some verbiage can vary.
common proper+es, opera<ons and behaviors. A combina<on of state (proper+es) and behavior (methods). A data type, and objects are instances of that data type. In other words, classes are prototypes from which objects are created. The blueprint.
An object receives all of the characteris<cs of a class, including all of its default data and any ac<ons that can be performed by its methods. Objects can communicate. An object passes a message to another object, which results in the invoca<on of a method. The “object” you build from the blueprint.
same characteris<cs, and have things in common with one another, but also may have certain proper<es that make them different. Object oriented programming allows classes to inherit commonly used state and behavior from other classes.
data structures* Object-‐Oriented • Bundles the two together, so an object, which is an instance of a class, operates on its "own" data structure. * A par'cular way of storing and organizing data in a computer so that it can be used efficiently