Fundamentals Of Programming

0.0(0)
studied byStudied by 0 people
learnLearn
examPractice Test
spaced repetitionSpaced Repetition
heart puzzleMatch
flashcardsFlashcards
Card Sorting

1/47

flashcard set

Earn XP

Description and Tags

topic 1 out of 4 for a level computer science paper one

Study Analytics
Name
Mastery
Learn
Test
Matching
Spaced

No study sessions yet.

48 Terms

1
New cards

what is a user defined data type

data types derived from existing data types

2
New cards

why are user defined data types used

to improve memory efficiency

3
New cards

what is a pointer or reference used for

to store memory locations

4
New cards

what is assignment

giving a created variable a value

5
New cards

what are some examples of user defined data types

pointers, enumerated data types, records, sets

6
New cards

what are procedures

subroutines without a return value

7
New cards

what are functions

subroutines that give a return value

8
New cards

what is truncation

removing the digits after the decimal place for a number

9
New cards

what are the advantages of named constants

easier debugging and they only require change in one place if needed

10
New cards

what is concatenation

joining two strings together to form one string

11
New cards

what are subroutines

out of line blocks of code that are called by name when they need to be executed

12
New cards

what are the advantages of using subroutines

allow for collaborative working, easier debugging and less repetition

13
New cards

what is a subroutine interface

what specifies the parameters that are passed to the subroutine

14
New cards

what are stack frames within subroutines

stacks used by a computer to store parameters, return addresses and local variables during subroutine execution

15
New cards

why are stack frames used in subroutines

to return to execution without affecting the main program code block or other subroutines

16
New cards

what is recursion

when something is defined in terms of itself

17
New cards

how does a recursive subroutine work

makes calls to itself until it reaches the stopping (base case) of conditions

18
New cards

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

19
New cards

what is a procedural programming paradigm

when code is formed from sequences of instructions that are executed in the order they appear

20
New cards

what is the structured approach

assignment, sequence, selection, iteration

21
New cards

which programming paradigm makes use of the structured approach

the procedural programming paradigm

22
New cards

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

23
New cards

what is a class

a blueprint for an object that defines its methods, properties and attributes

24
New cards

a single class definition can be used to create multiple objects, true or false

true

25
New cards

what is an object

a specific instance of a class

26
New cards

what are constructors

a function that is called to create and initalise an object

27
New cards

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

28
New cards

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

29
New cards

what is instantiation

creating a new object from a class

30
New cards

what is encapsulation

combining methods and procedures to form an object to make development easier

31
New cards

what is inheritance

when a class inherits from another class to share its properties

32
New cards

what properties does the inherited class have

all the properties and methods of the parent class as well as its own

33
New cards

what is association

a relationship between classes of objects

34
New cards

what are the two types of association

aggregation and composition

35
New cards

what is aggregation

a relationship between two , where one object uses another object as part of its state

36
New cards

in aggregation what will occur if the containing object is destroyed

the child object is not affected

37
New cards

in composition what occurs if the parent object is destroyed

the child object is also destroyed

38
New cards

which is a stronger form of association, aggregation or composition

composition

39
New cards

what is polymorphism

when the same inherited methods have different implementations for different classes

40
New cards

what is overriding

changing an inherited methods functionality

41
New cards

what are the three object orientated design principles

  • encapsulate what varies

  • favour composition over inheritance

  • program to interface, not implementation

42
New cards

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

43
New cards

why is composition favoured over inheritance

composition provides a more flexible relationship between methods

44
New cards

what does programming interfaces over implementation mean

allows unrelated classes to make use of similar methods

45
New cards

what is an interface

a collection of abstract procedures that allow for implementation by unrelated classes

46
New cards

describe how association is shown in class diagrams

with diamond headed arrows where aggregation is unfilled and composition is filled

47
New cards

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

48
New cards

what do the + and - represent in class diagrams

the + represents public and the - represents private