Cards (120)

  • What are programming constructs?
    Common building blocks for programs
  • What is the purpose of data types in programming?
    To organize data according to type
  • What is a variable in programming?
    A memory location for storing values
  • What does the data type determine for a variable?
    What type of value the variable will hold
  • What does the string data type hold?
    Characters that can be letters and/or numbers
  • What are the limitations of different data types?
    Integers and reals cannot be concatenated
  • What is casting in programming?
    Changing the data type of a variable
  • How would you convert an integer to a string in Python?
    Using str(68)
  • How would you convert a string to an integer in Python?

    Using int("54")
  • How do integers and real numbers differ in programming?
    Integers are whole numbers, reals are decimals
  • What is the relationship between data types and variable values?
    Data types define the kind of values variables hold
  • What are the three basic programming concepts?
    Sequence, selection, and iteration
  • What is the definition of sequence in programming?
    • A set of instructions that follow one another
    • The order in which instructions are processed
  • What is an instruction in computer programming?
    A single action performed by a processor
  • What does selection determine in a computer program?
    • The path a program takes based on events
    • A decision point within the program
  • What is iteration in programming?
    The repetition of a block of statements
  • What is execution in the context of programming?
    • The process of a program being run
    • The actual operation of code on a computer
  • What is definite iteration?
    A loop that repeats a set number of times
  • How is definite iteration usually implemented?
    Using a FOR loop
  • What is indefinite iteration?
    A loop that repeats until a condition is met
  • How is indefinite iteration typically implemented?
    Using a WHILE or REPEAT UNTIL loop
  • How do programming constructs relate to program complexity?
    • More constructs are used in complex programs
    • Constructs are the building blocks of all programs
  • What are programming constructs?
    Common building blocks for programs
  • What are the three basic programming concepts?
    Variables, constants, and iteration
  • What is a variable in programming?
    A memory location that holds a value
  • What is the purpose of an identifier?
    To name a variable in a program
  • What are the rules for naming a variable?
    Must start with a letter and contain letters
  • What is the difference between declaration and assignment?
    Declaration identifies a variable; assignment gives it a value
  • How would you declare a variable in Visual Basic?
    Dim score as Integer
  • What is a constant in programming?
    A named piece of memory with an unchangeable value
  • Why are constants useful in programming?
    They can be referred to multiple times without change
  • What is a global variable?
    A variable accessible throughout the whole program
  • What is a local variable?
    A variable that exists only within a subroutine
  • Why should global variables be avoided?
    They complicate debugging and memory management
  • What are the advantages of using local variables?
    • Easier to debug
    • Memory efficiency
    • Limited scope of access
  • What are the naming conventions for constants?
    • Written in uppercase
    • Follow similar rules as variables
    • Represent values unlikely to change
  • What is the difference between variables and constants?
    • Variables can change values; constants cannot
    • Both are named memory locations
    • Constants are often used for fixed values
  • What is the role of programming languages?
    • Used to write software
    • Provide syntax and structure for coding
    • Enable communication with computers
  • What is the significance of data types in programming?
    • Define the kind of data a variable can hold
    • Include integers, characters, and Boolean
    • Affect how data is processed in programs
  • What are programming constructs?
    Common building blocks for all programs