{[ promptMessage ]}

Bookmark it

{[ promptMessage ]}

Lecture 1-24 - • Encapsulation in the concept of putting...

Info iconThis preview shows page 1. Sign up to view the full content.

View Full Document Right Arrow Icon
Concept: Procedural Abstraction Procedural abstraction permits a code block that solves a particular sub-problem to be packaged and applied to different data inputs. “Supplying some parameters to the function, and it returns a value” Ex going to safeway to get foood, stop on the way to by some stuff, and go here and buy some stuff: OR Im going to do some ERRANDS. – By saying that it’s just errands, and create a code that solves very similar problems to this. Concept: Encapsulation
Background image of page 1
This is the end of the preview. Sign up to access the rest of the document.

Unformatted text preview: • Encapsulation in the concept of putting a wrapper around a collection that you wish to protect from outside influence. Functions encapsulate the code they contain in two ways: o The variable declared within the functions are not visible from elsewhere, o and the function’s ability to change the values of variables (otherwise known as causing side effects) is restricted to its own body. Function as a Black Box • P112 Functions Scope of Variables -...
View Full Document

{[ snackBarMessage ]}