Cards (93)

  • What is the term used to refer to data in programs?
    Values
  • What is a variable in programming?
    A variable is a named memory address that holds a value.
  • How does the value of a variable behave during program execution?
    The value held in a variable can change as the program is running.
  • What is the name given to a variable's name?
    Identifier
  • What is the process of identifying a variable before assigning a value to it called?
    Declaring a variable
  • What is the first rule for naming a variable?
    A variable name must start with a letter.
  • What does the declaration "score as integer" signify?
    It declares a variable called score that will hold integer values.
  • What must a variable name contain at least one of?
    It must contain at least one letter at the start of the name.
  • What is the term for giving a variable a value?
    Assignment
  • Which characters are not allowed in a variable name?
    Special characters such as !@£$%&* or punctuation characters.
  • What are the three basic programming constructs?
    Sequence, selection, and iteration
  • If you want to assign the value 0 to the variable score, what would the code look like?
    Score = 0
  • Can underscores be used in variable names?
    Yes, an underscore can be used in variable names.
  • What is the purpose of programming constructs in programs?
    They form the basis for all programs
  • What does sequence refer to in programming constructs?
    The order in which instructions occur and are processed
  • How does selection affect a program during execution?
    It determines which path a program takes when it is running
  • What is iteration in programming?
    The repeated execution of a section of code when a program is running
  • What are the two types of iteration in programming?
    • Count-controlled iteration
    • Condition-controlled iteration
  • How do some programming languages like Python handle variable declaration and assignment?

    They allow variables to be declared and assigned a value in the same line of code.
  • Why do longer and more complex programs use programming constructs repeatedly?
    Because they require more structured control over the flow of execution
  • Are spaces allowed in variable names?
    No, spaces are not allowed in variable names.
  • How do programming constructs contribute to the complexity of a program?
    They increase the structure and control of the program's execution flow
  • What is a constant in programming?
    A constant allows a value to be assigned a name that cannot be changed while the program is running.
  • What is the preferred case for letters in variable names?
    Lowercase letters are preferred, but uppercase letters can be used for multi-word names.
  • Why are constants useful in programming?
    They are declared and assigned once but can be referred to multiple times throughout the program.
  • Why should a variable name be meaningful?
    It should represent the value it is holding.
  • What is the first programming construct mentioned in the study material?
    Sequence
  • What is an example of a constant declaration?
    const PI = 3.142
  • How are statements executed in a sequence?
    Statements are executed one after another.
  • How do constants differ from variables in terms of naming conventions?
    Constants usually follow the same naming conventions as variables but are typically in uppercase.
  • What does the term 'sequence' refer to in programming?
    It refers to the order in which the statements are executed.
  • Why is the sequence of a program important?
    Because carrying out instructions in the wrong order leads to a program performing incorrectly.
  • What is a global variable?
    A global variable is one that can be accessed and changed throughout the program.
  • How does a programmer declare a global variable?
    By using the keyword 'global' before the variable name.
  • What is an example of declaring a global variable?
    global ID = 75
  • What are local variables confined to?
    A loop or subprogram
  • What is the second programming construct mentioned in the study material?
    Selection
  • What is an advantage of using local variables?

    They allow the same variable names to be used for different purposes in different scopes.
  • What does selection in programming refer to?
    Selection refers to the process of making a decision.
  • What is the third programming construct mentioned in the study material?
    Iteration