Cs 150 2nd le reviewer

Page 1

CS 150 – Programming Languages 2nd Long Exam Reviewer

Chapter 4 Names  String of _______ used to identify some entity in a program  Special words: used to make programs more readable by naming actions to be performed a) Keyboard - word that is special only in a certain contexts (by positioning) b) Reserved word - word that cannot be used as a name c) Predefined names - between reserved words and user-defined names -have predefined meanings that can be redefined by the user  _________ vs. Definitions Specify attributes and cause storage allocation Specify types and other attributes Variables  Abstraction of a computer memory call or collection of cells  Attribures: 1. Name - often referred to as identifiers 2. Address - memory address with which it is associated - sometimes called “l-value” - aliases: names that access a single memory location 3. Type - determines the range of values the variable can have and the set of operations that are defined for values of the type 4. Value - contents of the memory cell or cell associated with the variable - sometimes called “r-value” Binding  It is an association (attribute to entity, operation to symbol)  Binding time: time at which a binding takes place 1. Binding of Attributes to Variables a) Static - occurs before run time AND remains unchanged throughout program exec. b) Dynamic - occurs during run time OR can change in the course of prog. exec. 2. Type of Bindings - ________ of a variable to a data type a) Variable Declarations - create static bindings to types - Explicit declarations: statement that lists variable names with types - Implicit declarations: means of associating variables with types through default conventions instead of dec. statements : first instance/appearance = declaration b) Dynamic Type Binding - variable is bound to a type when it is assigned a value in a assigned statement 1


Turn static files into dynamic content formats.

Create a flipbook
Issuu converts static files into: digital portfolios, online yearbooks, online catalogs, digital photo albums and more. Sign up and create your flipbook.