3.2.2 Programming concepts

Cards (76)

  • What do variable types determine in programming?
    The kind of data stored
  • A float variable type is used for storing numbers with decimal places.

    True
  • A boolean variable can store either true or false
  • An integer variable can store numbers with decimals.
    False
  • Text in programming is stored in a variable type called a string
  • Order the following variable types from least to most storage capacity:
    1️⃣ Boolean
    2️⃣ Character
    3️⃣ Integer
    4️⃣ Float
    5️⃣ String
  • What are data structures used for in programming?
    Organizing and storing data
  • What is a key feature of a list data structure?
    It is mutable
  • Match the data structure with its example:
    Array ↔️ [1, 2, 3, 4, 5]
    List ↔️ ['apple', 2, 'banana']
    Tuple ↔️ (1, 2, 3)
    Set ↔️ {1, 2, 3, 4}
    Dictionary ↔️ {'name': 'Alice', 'age': 30}
  • What type of elements can a list store?
    Different types
  • Match the variable type with its description:
    Integer ↔️ Whole numbers
    Float ↔️ Numbers with decimals
    String ↔️ Text enclosed in quotes
    Boolean ↔️ Logical values
    Character ↔️ Single text character
  • What are data structures used for in programming?
    Organizing and storing data
  • What is a key feature of a list data structure?
    It is mutable
  • Match the data structure with its description:
    Array ↔️ Collection of elements of the same type
    List ↔️ Ordered and mutable collection
    Tuple ↔️ Ordered and immutable collection
    Set ↔️ Unordered collection of unique elements
    Dictionary ↔️ Collection of key-value pairs
  • An integer variable type is used for storing whole numbers
  • What type of data is stored in a string variable?
    Text
  • Match the variable type with its description:
    Integer ↔️ Whole numbers
    Float ↔️ Numbers with decimals
    String ↔️ Text enclosed in quotes
    Boolean ↔️ Logical values
    Character ↔️ Single text character
  • What is an example of a float value?
    3.14
  • A character variable stores single text characters.

    True
  • An array is a collection of elements of the same type
  • A set is an unordered collection of unique
  • Arrays have a fixed size in memory.

    True
  • Tuples are used to represent coordinates because they are immutable
  • Why is understanding variable types crucial in programming?
    Store and manipulate data
  • An array is a collection of elements of the same type
  • A set is an unordered collection of unique
  • Arrays have a fixed size in memory.
    True
  • Tuples are used to represent coordinates because they are immutable
  • The if-else statement allows the program to execute different code blocks based on a condition
  • What does a for loop execute code a fixed number of times?
    Yes
  • Order the execution of a while loop:
    1️⃣ Condition is checked
    2️⃣ Code block is executed
    3️⃣ Condition is checked again
  • What is the input of an algorithm?
    The data the algorithm uses
  • Control structures enable programs to make decisions and repeat actions
  • The input of an algorithm is the data it takes as its starting point
  • Functions encapsulate logic and break down complex problems into manageable pieces
  • Match the function component with its description:
    Parameters ↔️ Inputs the function accepts
    Return value ↔️ Output the function produces
  • The `greet()` function in the example returns a greeting message when called.

    True
  • Match the variable type with its example:
    Integer ↔️ x = 10
    Float ↔️ pi = 3.14
    String ↔️ name = "Alice"
    Boolean ↔️ isValid = true
    Character ↔️ grade = 'A'
  • What is the purpose of data structures in programming?
    Organize and store data
  • What type of elements can a list store?
    Different types