Foundation of Programming (AQA)

0.0(0)
learnLearn
examPractice Test
spaced repetitionSpaced Repetition
heart puzzleMatch
flashcardsFlashcards
Card Sorting

1/65

flashcard set

Earn XP

Study Analytics
Name
Mastery
Learn
Test
Matching
Spaced

No study sessions yet.

66 Terms

1
New cards

Data Types

Specifies the kind of data that can be stored and manipulated within a program. Examples: integers, real numbers, Booleans, characters, and strings.

2
New cards

Integer

Whole numbers without a fractional part, used for counting and indexing. Example: 5, -42

3
New cards

Real (Float)

Numbers that can contain a fractional part, used for measurements and continuous data. Example: 3.14, -0.001

4
New cards

Boolean

Represents true or false values, used for logical operations and conditional statements. Example: True, False

5
New cards

Character

A single alphanumeric character, used for text processing at a granular level. Example: 'A', '3'

6
New cards

String

A sequence of characters, used for text and sentences. Example: "Hello", "123ABC"

7
New cards

Variable Declaration

Introduces a variable by specifying its name and type. Example: age = 25

8
New cards

Constant Declaration

Defines a value that cannot be changed during program execution. Example: PI = 3.14159

9
New cards

Assignment

Assigns a value to a variable. Example: name = "Alice"

10
New cards

Iteration

Repeats a block of code multiple times or until a condition is met.

11
New cards

Selection

Makes decisions within a program based on conditions. Example: score = 85

12
New cards

Subroutine (Procedure/Function)

Encapsulates a block of code that performs a specific task. Example: def calculate_area(width, height): return width * height

13
New cards

Sequence

Default mode of execution where statements run one after the other.

14
New cards

Nested Iteration

Repeats a sequence of instructions within another iteration.

15
New cards

Nested Selection

Makes decisions within a program based on conditions within another selection.

16
New cards

Named Constants and Variables

Used to make programs easier to read and maintain. Constants ensure values do not change accidentally, while variables hold data that can change.

17
New cards

Meaningful Identifier Names

Improve code readability and maintainability by using descriptive names and consistent naming conventions. Examples: total_sum, user_age, calculate_area

18
New cards

Arithmetic Operations in Programming

Include addition, subtraction, multiplication, real division, integer division, and remainders.

19
New cards

Modular Arithmetic

Used in scenarios requiring periodicity, such as clock arithmetic.

20
New cards

Relational Operations

Include common relational operators like Equal To, Not Equal To, Less Than, Greater Than, Less Than or Equal To, and Greater Than or Equal To.

21
New cards

Boolean Operations

Include common Boolean operators like NOT, AND, and OR.

22
New cards

Data Structures

Ways of organizing and storing data efficiently. Examples: Arrays, Records (Structures).

23
New cards

Records

Used to group different data types under one name, allowing for a structured way to represent real-world entities.

24
New cards

Arrays

A collection of elements of the same type, stored in contiguous memory locations.

25
New cards

One-Dimensional Array

Example: numbers = [1, 2, 3, 4, 5]

26
New cards

Two-Dimensional Array

Example: matrix = [[1, 2, 3], [4, 5, 6], [7, 8, 9]]

27
New cards

Efficiency

Data structures like arrays allow for efficient storage and retrieval of data.

28
New cards

Organization

Records provide a structured way to store related data fields.

29
New cards

Simplicity

Arrays and records simplify the implementation of algorithms and data manipulation operations.

30
New cards

User Input

Obtaining user input from the keyboard in Python using the input() function.

31
New cards

Output Data

Using the print() function in Python to display data and information on the computer display.

32
New cards


Length

Using the len() function in Python to get the length of a string.

33
New cards

Position

Accessing individual characters in a string by their position using zero-based indexing.

34
New cards

Substring

Extracting a part of a string.

35
New cards

Concatenation

Joining two strings together.

36
New cards

Convert Character to Character Code

Using ord() to get the ASCII value of a character and chr() to get the character from an ASCII value.

37
New cards

String Conversion Operations

Converting between different data types like string to integer, real to string, etc.

38
New cards

Generating Random Integer

A specified range using randint() to generate a number from the random module.

39
New cards

Generating Random Float

Generating a random number between 0.0 and 1.0 using the random() function.

40
New cards

Random Choice from a Sequence

Choosing a random element using the choice() function.

41
New cards

Shuffling a Sequence

Randomly shuffling the elements of a sequence using the shuffle() function.

42
New cards

Simulation

Simulating random events or behaviors.

43
New cards

Games

Generating random game scenarios, outcomes, or choices.

44
New cards

Statistical Sampling

Generating random samples for statistical analysis.

45
New cards

Cryptographic Applications

Creating cryptographic keys or initialization vectors.

46
New cards

Subroutine

A named 'out of line' block of code that can be executed by writing its name in a program statement.

47
New cards

Procedures

Subroutines that perform actions but do not return a value.

48
New cards

Functions

Subroutines that perform actions and return a value.

49
New cards

Modularity

Breaks programs into manageable sections. Each subroutine performs a specific task, making it easier to understand and manage.

50
New cards

Simplified Maintenance

Easier to update and fix code. Changes in a subroutine affect all calls to it, reducing the need to make multiple updates.

51
New cards

Improved Readability

Makes code more organized and easier to understand. Subroutines give structure and clarify the purpose of each part of the code.

52
New cards

Enhanced Collaboration

Different programmers can work on different subroutines simultaneously. This is particularly useful in large projects.

53
New cards

Parameters

Variables listed as part of a subroutine's definition, allowing data to be passed into the subroutine.

54
New cards

Data Passing by Value

A copy of the data is passed to the subroutine.

55
New cards

Data Passing by Reference

A reference to the actual data is passed, allowing modifications.

56
New cards

Returning Values from Subroutines

Subroutines can return a value to the calling routine using the return statement.

57
New cards

Local Variables in Subroutines

Variables declared within a subroutine, accessible only within that subroutine.

58
New cards

Structured Approach

A method of programming that emphasizes breaking a program into smaller, manageable, and reusable modules or subroutines.

59
New cards

Common Validation Checks

Includes minimum length check, empty string check, and range check for validating input data.

60
New cards

Simple Authentication Routines

Example of an authentication routine that checks username and password for validity.

61
New cards

Testing

Involves running a program to find errors or confirm expected behavior under different conditions.

62
New cards
63
New cards

Types of Errors

Syntax errors and logic errors are common types of errors in programming.

64
New cards

Records (Structures)

Used to group different data types under one name, allowing for a structured way to represent real-world entities. This is akin to a form where different fields (like name, address, phone number) are filled out for each individual.

65
New cards

Syntax Error

Errors due to incorrect code syntax

66
New cards

Logic Error

Errors where program runs but produces incorrect results