1/47
topic 1 out of 4 for a level computer science paper one
Name | Mastery | Learn | Test | Matching | Spaced |
---|
No study sessions yet.
what is a user defined data type
data types derived from existing data types
why are user defined data types used
to improve memory efficiency
what is a pointer or reference used for
to store memory locations
what is assignment
giving a created variable a value
what are some examples of user defined data types
pointers, enumerated data types, records, sets
what are procedures
subroutines without a return value
what are functions
subroutines that give a return value
what is truncation
removing the digits after the decimal place for a number
what are the advantages of named constants
easier debugging and they only require change in one place if needed
what is concatenation
joining two strings together to form one string
what are subroutines
out of line blocks of code that are called by name when they need to be executed
what are the advantages of using subroutines
allow for collaborative working, easier debugging and less repetition
what is a subroutine interface
what specifies the parameters that are passed to the subroutine
what are stack frames within subroutines
stacks used by a computer to store parameters, return addresses and local variables during subroutine execution
why are stack frames used in subroutines
to return to execution without affecting the main program code block or other subroutines
what is recursion
when something is defined in terms of itself
how does a recursive subroutine work
makes calls to itself until it reaches the stopping (base case) of conditions
what happens if there is no base case in a recursive subroutine
stack overflow occurs as more and more is pushed onto the stack frame
what is a procedural programming paradigm
when code is formed from sequences of instructions that are executed in the order they appear
what is the structured approach
assignment, sequence, selection, iteration
which programming paradigm makes use of the structured approach
the procedural programming paradigm
what are the advantages of the procedural programming paradigm
it is designed from the top down so each problem can be Brocken down into smaller parts and developed and tested individually
what is a class
a blueprint for an object that defines its methods, properties and attributes
a single class definition can be used to create multiple objects, true or false
true
what is an object
a specific instance of a class
what are constructors
a function that is called to create and initalise an object
what is an implicit vs an explicit constructor
implicit is when the constructor is predetermined by programming tools, whereas explicit is when the contractor is determined by the programmer
what is a reference variable
variables that do not contain their own data, but instead point to a specific object from a class and allow its values to be accessed
what is instantiation
creating a new object from a class
what is encapsulation
combining methods and procedures to form an object to make development easier
what is inheritance
when a class inherits from another class to share its properties
what properties does the inherited class have
all the properties and methods of the parent class as well as its own
what is association
a relationship between classes of objects
what are the two types of association
aggregation and composition
what is aggregation
a relationship between two , where one object uses another object as part of its state
in aggregation what will occur if the containing object is destroyed
the child object is not affected
in composition what occurs if the parent object is destroyed
the child object is also destroyed
which is a stronger form of association, aggregation or composition
composition
what is polymorphism
when the same inherited methods have different implementations for different classes
what is overriding
changing an inherited methods functionality
what are the three object orientated design principles
encapsulate what varies
favour composition over inheritance
program to interface, not implementation
what does encapsulate what varies mean?
any requirements that are likely to change are encapsulated within a class so that they can easily be modified
why is composition favoured over inheritance
composition provides a more flexible relationship between methods
what does programming interfaces over implementation mean
allows unrelated classes to make use of similar methods
what is an interface
a collection of abstract procedures that allow for implementation by unrelated classes
describe how association is shown in class diagrams
with diamond headed arrows where aggregation is unfilled and composition is filled
how are class diagrams written out
in three boxes, where the top box shows the class name, properties in the middle, and methods at the bottom
what do the + and - represent in class diagrams
the + represents public and the - represents private