CS - paper 1

0.0(0)
Studied by 0 people
call kaiCall Kai
learnLearn
examPractice Test
spaced repetitionSpaced Repetition
heart puzzleMatch
flashcardsFlashcards
GameKnowt Play
Card Sorting

1/69

encourage image

There's no tags or description

Looks like no tags are added yet.

Last updated 6:02 PM on 5/30/26
Name
Mastery
Learn
Test
Matching
Spaced
Call with Kai

No analytics yet

Send a link to your students to track their progress

70 Terms

1
New cards

data type definition

any values that can be taken by the program, or the operations which can be performed on it

2
New cards

Data types

  • integers

  • real/float

  • Boolean

  • character

  • string

  • date/time

  • pointer/reference

  • records

  • arrays

3
New cards

integer

whole number, can be positive or negative

includes zero

4
New cards

real/float

positive/negative values, can have a fractional part

5
New cards

Boolean

A value which is either true or false

6
New cards

Character

A single letter or symbol

7
New cards

string

a collection of characters

8
New cards

date/time

ways of storing a point in time

9
New cards

pointer/reference

used as stores for memory addresses of objects created at runtime i.e. dynamically

10
New cards

records

collection of fields, each can have a different data type

11
New cards

arrays

finite, index set of related elements with same data type

12
New cards

user-defined data types based on language defined(built-in) data types

derived from existing data types to create a customised data structure

ensures solution is as memory efficient as possible

13
New cards

variable declaration

giving a variable a name/data type

allocates memory

14
New cards

constant declaration

constant does not change

15
New cards

Assignment

giving constant/variable a value

16
New cards

Iteration

repeating an instruction, could be definite or indefinite

17
New cards

selection

comparing values and choosing action accordingly

18
New cards

subroutine (procedure/function)

‘out of line’ block of code containing set of instructions to perform a frequently used operation

executed by writing it’s name in a program statement

19
New cards

three combining processes basic to all imperative programming languages

  • sequence

  • iteration

  • selection

20
New cards

definite iteration

number of repetitions known before loops starts

21
New cards

indefinite iteration

number of repetitons unknown

22
New cards

nested selection/iteration

  • one placed within another

  • identified with indentation

23
New cards

why is it important to use meaningful identifier names

sensible and easy for others to understand

24
New cards

integer division, including remainders

MOD - modulus

25
New cards

when are relational operations used (=><)

used in iteration, selection structures, and for base cases in recursion

26
New cards

advantages of using named constants

easier to understand, clear

e.g. hrrate= 14

hrworked=input

PAY=hrRate*hrworked

easier to update in one place

27
New cards

random number generation

built in function

takes seed value and uses series of mathematical operations to arrive at a number

pseudorandom

28
New cards

exception handling

  • when the wrong data type is used

  • computer handles exceptions to avoid crashing by pausing execution and saving the current volatile state on system stack before running a catch block

  • the catch block stops crash and informs user of error

29
New cards

parameters of subroutines

  • arguments

  • used to pass data within programs

30
New cards

function

subroutines that return a value/ valyes

31
New cards

local variables in subroutines

  • exist only when the subroutine is executing

  • are accessible only within the subroutine

  • more memory efficient

32
New cards

global variables

  • accessible from any part of the program

  • exist in memory for the duration of run

  • local can be given the same identifier, can change local while global stays the same

33
New cards

how are stack frames used in subroutine calls

stores:

  • return addresses

  • parameters

  • local variables

for each subroutine call

  • useful with nesting, each popped when finished

34
New cards

recursive techniques

subroutine defined in terms of itself

35
New cards

base case in recursive techniques

stopping conditions - if not, stack overflow

36
New cards

simple problems using recursion

  • factorial

  • binary search

37
New cards

programming paradigm

  • procedural/functional programming

  • object-oriented programming

38
New cards

procedural-oriented programming

formed from sequence of instructions executed in the order that they appear

data stored by constants and variables

39
New cards

procedural-oriented programming - components

  • assignment

  • sequence

  • selection

  • iteration

40
New cards

procedural-oriented programming - design/adv.

Top-down design

  • broken down into smaller tasks

  • allows for testing of each individual component

  • able to split between teams/team members

  • navigation improved → maintenance easier

41
New cards

procedural-oriented programming - hierarchy charts

graphically represents the structure of the program

procedure = rectangle

42
New cards

class

blueprint for objects, defines property/attribute fields that capture the common behaviours and characteristics of objects

43
New cards

object

  • one class can have many objects

  • methods across classes can be the same but value of the objects is unique

  • methods will have private(only accessed within object), public allow interface for accessing and modifying a class

44
New cards

Instantiation

class created

45
New cards

inheritance

allows one class to share properties and methods of another, while having own

46
New cards

Association

Object forms part of it’s container object

  • aggregation

  • composition

47
New cards

Aggregation

Weaker, associated object will still exist without other, e.g. passengers in a car

48
New cards

composition

stronger, destroyed together, e.g. wheels of a car

49
New cards

Polymorphism

objects processed differently depending on their class

50
New cards

overriding

if method has same name as method in inherited class but different implementation

51
New cards

unified modelling language - composition and aggregation

composition → represented by black diamond line

aggregation → white diamond line

52
New cards

why is the object oriented paradigm used

  • clear structure

  • development and testing easier

  • divide tasks in team

  • reusable blocks increase space efficiency

53
New cards

object oriented paradigms

  • encapsulate what it varies

  • favour composition over inheritance

  • program to interfaces, not implementation

54
New cards

encapsulate what it varies

any requirements likely to change should be encapsulated into a class

55
New cards

favour composition over inheritance

composition is more flexible but isn’t always appropriate

allows unrelated classes to make use of similar methods

56
New cards

program to interfaces, not implementation

collection of abstract procedures that can be implemented by unrelated classes

57
New cards

abstract methods

blueprint for methods that must be implemented by subclasses

58
New cards

virtual methods

base case that can be overridden, allows subclasses to provide specific implementation

59
New cards

static methods

belong to class rather than instance

60
New cards

types of specifiers in oop

  • public

  • private

  • protected

61
New cards

class diagram symbols for specifiers

  • public → +

  • private → -

  • protected → #

62
New cards

dynamic data structures

can be expanded given limitation of available memory

63
New cards
64
New cards
65
New cards
66
New cards
67
New cards
68
New cards
69
New cards
70
New cards