PLS

    Cards (102)

    • What do the <> symbols indicate in PLS?
      They indicate where values need to be supplied
    • What character indicates a comment in PLS?
      #
    • What are identifiers in PLS?
      Sequences of letters, digits, and underscores
    • What is the first character of an identifier?
      It must start with a letter
    • How are data types assigned to variables in PLS?
      Explicitly during declaration or implicitly during initialization
    • What are the supported primitive data types in PLS?
      • integer (int)
      • real (float)
      • Boolean (bool)
      • character (str)
    • What is the purpose of conversion in PLS?
      To transform the data types of variable contents
    • How are constants named in PLS?
      In all uppercase characters
    • What does combining declaration and initialization imply?
      The data type is implied when a value is assigned
    • What are structured data types in PLS?
      • Sequence of items, each typed
      • Start with an index of zero
    • What is a string in PLS?
      A sequence of characters
    • What is an array in PLS?
      A sequence of homogeneous items
    • What is a record in PLS?
      A sequence of heterogeneous items
    • How many dimensions does PLS support?
      Two dimensions
    • What does PLS not support regarding data structures?
      Ragged data structures
    • What are the arithmetic operators in PLS?
      • / : division
      • * : multiplication
      • ** : exponentiation
      • + : addition
      • - : subtraction
      • // : integer division
      • % : modulus
    • What are the relational operators in PLS?
      • == : equal to
      • != : not equal to
      • > : greater than
      • >= : greater than or equal to
      • < : less than
      • <= : less than or equal to
    • What are the logical/Boolean operators in PLS?
      • and : both sides must be true
      • or : either side must be true
      • not : inverts the value
    • What is the purpose of assignment in PLS?
      To set or change the value of a variable
    • How is sequence structured in PLS?
      Instructions come one after the other
    • What indicates blocking of code segments in PLS?
      Indentation and subprogram calls
    • What is the selection structure in PLS?
      • if <expression>: <command>
      • if <expression>: <command> else: <command>
      • if <expression>: <command> elif <expression>: <command> else: <command>
    • What does the 'if' statement do in PLS?
      Executes command if expression is true
    • What is the purpose of 'elif' in PLS?
      To check another expression if the first is false
    • What does the 'else' statement do in PLS?

      Executes command if previous expressions are false
    • What is the repetition structure in PLS?
      • while <condition>: <command>
      • for <id> in <structure>: <command>
    • What does the 'while' loop do in PLS?
      Executes command while condition is true
    • What does the 'for' loop do in PLS?
      Executes command for each element in structure
    • What is a count-controlled loop in PLS?
      Executes command a fixed number of times
    • What does the 'range' function do in PLS?
      Generates a list of numbers
    • What are the types of subprograms in PLS?
      • Procedures (with or without parameters)
      • Functions (with or without parameters)
    • What does the 'def' keyword indicate in PLS?
      Defines a procedure or function
    • What does the 'return' statement do in PLS?
      Returns a value from a function
    • What are the input and output methods in PLS?
      • print(<item>): Displays item on screen
      • input(<prompt>): Returns user input
    • What file operations are supported in PLS?
      • open, close, read, write, append
    • How do you open a file for reading in PLS?
      <fileid> = open(<filename>, "r")
    • What does <fileid>.readlines() do in PLS?
      Returns a list of lines from the file
    • What does <fileid>.readline() do in PLS?
      Returns a line from the file
    • How do you open a file for writing in PLS?
      <fileid> = open(<filename>, "w")
    • How do you close a file in PLS?
      <fileid>.close()
    See similar decks