Additional Programming Techniques

Cards (25)

  • What is an array in programming?
    A static data structure for fixed data elements
  • What must each data element in an array be?
    Of the same data type
  • What is the index in an array?
    A number indicating the position of elements
  • What index does the first element in an array have?
    0
  • How can you traverse an array in programming?
    Using a for loop
  • Can you insert new values into an array?
    No, the size is fixed
  • What happens when you overwrite the fourth element in an array?
    It changes to the new value
  • How do you delete a value in an array?
    Overwrite it with a blank
  • What is needed to search through a large array?
    A for loop to check each element
  • What is a two-dimensional array?
    An array with multiple rows and columns
  • How is indexing done in a two-dimensional array?
    Using two index values for row and column
  • How do you print a specific data element in a two-dimensional array?
    Use the index number
  • How do you search for a specific value in a two-dimensional array?
    Use two for loops
  • What can records store that arrays cannot?
    Data of different data types
  • What is each piece of information in a record called?
    A field
  • What is a key field in a record?
    Unique data identifying each record
  • Why is Student ID a good key field?
    No two students can have the same ID
  • What does SQL stand for?
    Structured Query Language
  • What is the purpose of SQL?
    To search for data in a database
  • What is the format of an SQL statement?
    SELECT field1 FROM table WHERE criteria
  • What does the * symbol represent in SQL?
    All fields
  • Write an SQL statement to select all fields for cars that are grey or blue.
    SELECT * FROM Cars WHERE Colour = "grey" OR Colour = "blue"
  • Write an SQL statement to display all fields for cars that are 10 years old or less.
    SELECT * FROM Cars WHERE Age <= 10
  • What are the differences between a 1D array, 2D array, and record?
    • 1D Array: Fixed size, same data type
    • 2D Array: Multiple rows and columns, same data type
    • Record: Different data types, contains fields
  • What are the steps to manipulate arrays in pseudo code?
    1. Traverse: Use a for loop
    2. Insert: Change existing values
    3. Delete: Overwrite with blank
    4. Search: Use a for loop for specific value