4.1 Fundamentals of Programming AQA Comp Sci

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

1/60

Study Analytics
Name
Mastery
Learn
Test
Matching
Spaced

No study sessions yet.

61 Terms

1
New cards

Integer

whole numbers

2
New cards

Real/Float

Decimal numbers

3
New cards

Boolean

True or False (1 or 0)

4
New cards

Character

A single symbol

5
New cards

String

A sequence of characters

6
New cards

Date/Time

Stores date and time values

7
New cards

Point/Refrence

Holds memory address of a variable

8
New cards

Record

A structured data type, similar to a dictionary

9
New cards

Array

A collection of elements of the same type

10
New cards

List

An array that can be comprised of multiple data types

11
New cards

Arrays vs Lists vs Tuples

Lists are dynamic, mutable with multiple data types

Arrays are fixed, mutable with a single data type

Tuples are fixed, immutable and hold a single data type

12
New cards

Variable Declaration

Declaring the name of a variable

13
New cards

Constant Declaration

Declaring the name of a constant

14
New cards

Assignment

Assigning a value to a variable or constant

15
New cards

Iteration

Repeats a block of code multiple times

16
New cards

Definite Iteration

Iterates for a certain number of values (i.e. for loop)

17
New cards

Indefinite Iteration

Iterates for an unknown number of times (i.e. while loop)

18
New cards

Subroutine

Block of reusable code available when called

19
New cards

Nested Structure

A programming structure where one structure is contained within another

20
New cards

Truncation

Removes the decimal part of a number without rounding

21
New cards

Ceiling

rounds a number up to the nearest integer

22
New cards

Floor

rounds a number down to the nearest integer

23
New cards

Local Variables

Declared inside a function, exist only within the function, cannot be accessed from outside

24
New cards

Advantages of Local Variables

Saves memory as created and destroyed when needed, prevents unintended modification

25
New cards

Global Variable

Declared outside all functions, accessible throughout the program

26
New cards

Disadvantages of Global Variables

makes debugging harder, can accidentally override values, functions become less reusable

27
New cards

A Stack Frame consists of

Return Address, Contents of Registers, parameters to be passed, local variables

28
New cards

Base Case (Recursive Techniques)

The condition which stops recursion

29
New cards

Recursive Case

The function calls itself

30
New cards

Recursion

Where a function calls itself to solve a problem by breaking it down into smaller, more manageable parts

31
New cards

Advantages of Recursion

simplifies problem, more elegant and easier to read

32
New cards

Disadvantages of Recursion

High memory usage, can lead to stack overflow, iterative solutions often more efficient

33
New cards

Programming Paradigms

Ways to classify programming based on their methodology, including object-oriented, functional, and procedural.

34
New cards

Procedural-Oriented Programming

Uses sequential execution, selection, and iteration to control flow of program.

35
New cards

Advantages of Procedural Programming

easy to debug and modify, easy to write and understand, reusable functions improve efficiency, good for tasks that have a clear sequence of operations

36
New cards

Disadvantage of Procedural Programming

harder to maintain for large-scale projects, code reusability is limited compared to OOP

37
New cards

Object-Oriented Programming (OOP)

Organises code around data or objects, rather than functions and logic.

38
New cards

Class (OOP)

A blueprint for creating objects, containing attributes and methods.

39
New cards

Attribute (OOP)

Properties of a class (values)

40
New cards

Method (OOP)

Subroutines inside a class that can be called

41
New cards

Object (OOP)

An instance of a class allocated in memory

42
New cards

Instantiate (OOP)

To create an instance of an object, stored inside a variable

43
New cards

Inherit (OOP)

To build a relationship between similar classes.

44
New cards

Parent (OOP)

A super class of a child.

45
New cards

Chid (OOP)

A sub class of a parent - inherits the same attributes and methods

46
New cards

Encapsulation (OOP)

Bundling of data into a class with the methods that operation on that data, using getters and setters. Hides values within the class to protect them from outside interference.

47
New cards

Private (OOP)

Components that can only be seen and changed in the class

48
New cards

Protected (OOP)

Components that can only be seen and changed in the class, or subclasses of that.

49
New cards

Public (OOP)

Components that can be seen and changed anywhere in the code

50
New cards

Polymorphism (OOP)

Enables objects of different classes to be treated as objects of a common superclass, allowing methods to perform differently based on the object's actual class.

51
New cards

Overriding (OOP)

When a subclass provides as specific implementation of a method that is already defined in the parent class, replacing the base functionality.

52
New cards

Association (OOP)

A general relationship between classes that doesn’t imply ownership.

53
New cards

Aggregation (OOP)

A type of relationship between two classes where one has a reference but can exist independently.

54
New cards

Composition (OOP)

A stronger form of association where the class cannot exist without another (Death Relationship)

55
New cards

Abstract Method (OOP)

A method defined in an abstract class that has no implementation.

56
New cards

Virtual Method (OOP)

A method in a base class that is intended to be overridden in child classes.

57
New cards

Static Method (OOP)

A method that belongs to the class itself, rather than any instance of a class. Static methods can be called without creating an instance.

58
New cards

Interface (OOP)

A skeleton or outline of a class where methods are defined but not implemented.

59
New cards

Composition in Class Diagrams

black diamond

60
New cards

Aggregation in Class Diagrams

white diamond

61
New cards

Public, Private, Protected - Class Diagrams

+, -, #