2)functions- like functions from algebra, where you put in a value and out come another.
methods- non globally accessible functions through objects
3) Object-oriented programming is about nouns. You define variables for the objects and you define functions (methods) for the objects.~no global functions or variables(things that are accessible everywhere)~ Procedural programming is about verbs. Telling the computer to do something, and then to do it to your data. ~re-using predefined functions wherever possible~
4) Polymorphism:
when the same name can be used to invoke different methods that achieve the same goal
5) Encapsulation:
when the data and behavior of the object are defined in one and only one place, so that any change to one is easliy changed in the other.
6) Aggregation:
being able to use lots of objects (like, lists of objects)
Encapsulation, Polymorphism, and Aggregation definitions are okay, but not complete. Mark Guzdial
1) a class is like a blueprint of something (i.e., a box) whereas an object is a real object with actual data. In "Working with Classes," REMOVED is a class and joe is an object. Student1192
Is the answer to 2 sufficient?? would it be better to say that functions are globally accessible, while methods are not (because are only accessible through objects)?
1) objects are instances of classes in many object-oriented languages; a class defines the data and behavior of an object (a class defines what all instances of that class know and can do)
4) polymorphism: when the same method name can be applied to REMOVED than one object, it is polymorphic (writeTo() is polymorphic for sounds and pictures) with polymorphism you only have to remember the name and the goal.
5) encapsulation: a property of objects that each holds it own data and behavior that we can't reach inside another object (objects encapsulate data and behavior)
6)aggregation: describes how objects can be combined (objects within objects) to create REMOVED complex structures, you can have lots of objects doing useful things Student1153
2) a function is a recipie that tells the computer what to do. It is recognized everywhere and can be executed by referencing it's name. A method is a function but not globally accessible. It is a function that is specific to an object. Must be executed using dot notation.
anu
7-Alan Kay study biological cells and used it to help him describe objects as being like them. He said they that objects, like biological cells, work together in well-defined ways to make the whole organism (program/function) work. Like cells, Alan said that objects would:
help manage complexity by distributing responsibility for tasks across many objects, rather than just one big program.
REMOVEDpport robustness by making the objects work relatively independently.
REMOVEDpport reuse because each object would provide services to other objects (tasks that the object would do for other objects, accessible through its methods)—just as real world objects do.
This is directly from the text, but I thought I'd help out and post it since I have used other people's post to help me! It's on page 305 of your text! I hope this helps!
Student1113
3)Functional programming enables programming in few lines. Basically you create short programs (that can do a lot) by layering functions. "Focusing on functions as data and functions that use functions as input are the key ideas in functional programming,"(300, Inrto. to media comp.)
Procedural programming is programming by defining procedures; verb-oriented programing:your telling the computer to perform this or that action.
Object oriented programming is noun oriented programming: that is one finds the objects that are associated with the problem and the solution and work with them using methods and instance variables.
ANu
1)A class defines the instance variables(what objects know) and methods(what objects can do) for a set of objects. Each object of that class is called an instance of that class.
In the sample code, the print statement if the item is found has the beginning of what is to be printed and the end of what is to be printed separated by a colon. Must this be a colon or could it also be a comma?