Save
COMPUTER 4Q G8
Save
Share
Learn
Content
Leaderboard
Learn
Created by
Sam Gab
Visit profile
Subdecks (1)
FUNCTIONS
COMPUTER 4Q G8
8 cards
Cards (23)
Global Variables
are declared outside any function, they have a
global scope
and thus are available for any function in the program, including
main.
Local variables are
within
/
inside
the function only
Scope
refers to the
section
of
code
where a
variable
is allowed to be
accessed
or
referenced.
Pass-by-reference method
states that parameters that will only accept values from
other
functions of the program
Overloading
Functions
states that it is valid to give
severa
l functions the same name, it only has to have a different set of parameters.
Function
overloading
allows the function to have many
forms
Function polymorphism
allows functions to be overloaded
The area of a
circle
is computed using the equation 3.14*r2(r =
radius
)
The area of a
square
is computed using the equation s² (s =
length of one side
)
The area of a
rectangle
is computed using the equation
1*w
(
length x width
)
Pass-by-value method-
Parameters only accept values passed on to them
Arguments- Values
which may be variables passed on to functions
Function declaration-
a way to identify data types
Class-
representation of abstract data
Constructor-
Object of the class is created
Destructor-
Object is
destroyed
Accessor
methods-
Allow access to data members
See all 23 cards