Cards (87)

  • What is required for proficient programming?
    Knowledge of many techniques
  • What do operators in programming determine?
    What action is to be performed or considered
  • What are the three types of operators used in programming?
    • Arithmetic operators
    • Relational operators
    • Boolean operators
  • What is an arithmetic operator?
    A mathematical function for calculations
  • What functions do arithmetic operators perform?
    Add, subtract, multiply, and divide
  • What is a relational operator?
    An operator that compares two values
  • What are Boolean operators used for?
    Building complex queries in a database
  • What are the common Boolean operators?
    AND, OR, and NOT
  • What is a high-level programming language?
    A language used to write programs
  • What is needed to translate high-level languages into machine code?
    A compiler, interpreter, or assembler
  • What are the key components of programming languages discussed?
    • Operators: arithmetic, relational, Boolean
    • High-level languages: require translation to machine code
  • What is the purpose of arithmetic operators in programming?
    To perform calculations on values
  • What is an arithmetic operator?
    A function to perform calculations
  • What does the addition operator do?
    Adds two values together
  • How is subtraction represented in programming?
    With the operator -
  • What is the multiplication operator in programming?
    The operator * for multiplying values
  • What does real division do in programming?
    Divides and returns a decimal result
  • What is integer division represented by?
    The operator DIV
  • What does the remainder operator (MOD) do?
    Returns the remainder of a division
  • What is the result of 9 DIV 29 \text{ DIV } 2?

    2
  • What is the result of 29 DIV 729 \text{ DIV } 7?

    4
  • What is the result of 12 MOD 512 \text{ MOD } 5?

    2
  • What is the result of 23 MOD 623 \text{ MOD } 6?

    5
  • What are the main arithmetic operations in programming?
    • Addition (+)
    • Subtraction (-)
    • Multiplication (*)
    • Real division (/)
    • Integer division (DIV)
    • Remainder (MOD)
  • How do integer division and remainder division differ?
    • Integer division (DIV): Discards remainder
    • Remainder division (MOD): Returns remainder
  • What is a relational operator?
    An operator that compares two values
  • What is the purpose of assignment in programming?
    Setting the value of a variable
  • What does a condition in computing represent?
    A statement that is either true or false
  • What is an IF statement used for in programming?
    To select an action based on a condition
  • What is a loop in programming?
    The repetition of an activity
  • What are the relational operations in programming?
    • Equivalence: ==
    • Less than: <
    • Less than or equal to: <=
    • Greater than: >
    • Greater than or equal to: >=
    • Does not equal: <> or !=
  • How would you assign the value 5 to variable x?
    x = 5
  • How would you check if x is equal to 5?
    if x == 5
  • How would you check if x is less than 5?
    if x < 5
  • How would you check if x is greater than or equal to 5?
    if x >= 5
  • How would you check if x does not equal 5?
    if x <> 5
  • What does the following code check: IF LEN(password) >= 6 THEN?
    • Checks if password length is 6 or more
    • Outputs "Good Password!" if true
    • Outputs "Password too short" if false
  • What is the output if the password is less than 6 characters?
    Password too short
  • What does the LEN function do in programming?
    It returns the length of a string
  • How do relational operators facilitate programming logic?
    They allow comparisons to be made