Componet 2 School

Cards (121)

  • What is an algorithm?
    A set of steps to solve a problem
  • What does 'input' refer to in an algorithm?
    Data given to the algorithm by the user
  • What are 'processes' in an algorithm?
    Steps taken to solve the problem
  • What does 'output' refer to in an algorithm?
    Data given back to the user
  • What is abstraction in computational thinking?
    • Making a model of a situation
    • Analyzing the model for insights
  • What is decomposition in computational thinking?
    • Breaking down complex problems
    • Simplifying the problem-solving process
  • What is algorithmic thinking?
    • Creating a model of a real-life situation
    • Defining a solution through steps
  • What do variables in a program represent?
    Real values
  • What do functions in a program represent?
    A group of actions producing a result
  • What are the advantages of decomposition in programming?
    • Work on individual parts separately
    • Use a team for large problems
  • What are examples of algorithms?
    • Flowcharts
    • Pseudocode
    • Trace Tables
    • Structure Diagrams
  • What do flowcharts represent in algorithms?
    The flow of data, processing, and input/output
  • What do standard flowchart symbols represent?
    • Line: Flow of data
    • Process: Action performed
    • Input/Output: Data entry/exit
    • Decision: Conditional branching
    • Terminal: Start/End of flowchart
  • What is a trace table used for?
    Tracking variable changes in an algorithm
  • How do you draw a trace table?
    Create a column for each variable used
  • What is pseudocode?
    • Not an actual programming language
    • Follows a similar structure to programming languages
    • Clearly shows algorithm steps
  • What is the output of the pseudocode example with num and n?
    9
  • What is a linear search?
    Looks at each item until the target is found
  • What is a binary search?
    Divides the data list in half repeatedly
  • What is a bubble sort?
    Compares pairs of values and swaps them
  • What is the method of a bubble sort?
    • Compare pairs of values
    • Swap if different
    • Repeat until no swaps
  • What is an insertion sort?
    Inserts each item into the correct place
  • What is the method of an insertion sort?
    1. Split into ordered and unordered
    2. Insert each item into the correct place
    3. Repeat until all items are sorted
  • What is a merge sort?
    A two-stage sorting algorithm
  • What is the method of a merge sort?
    1. Split data into sublists
    2. Merge sublists in sorted order
    3. Repeat until one sorted list remains
  • What is a variable in programming?
    A label for a memory location
  • What is a constant in programming?
    A label for an unchangeable value
  • What is assignment in programming?
    Setting a value to a variable or constant
  • What is declaration in programming?
    Identifying a variable or constant
  • What are the types of program structures?
    • Sequence: Instructions in order
    • Selection: Conditional paths (IF, THEN)
    • Iteration: Repeating instructions
  • What are comparison operators?
    • == Equal To
    • <> Not Equal To
    • < Less Than
    • > Greater Than
    • <= Less Than or Equal To
    • >= Greater Than or Equal To
  • What are arithmetic operators?
    • + Addition
    • - Subtraction
    • * Multiplication
    • / Division
    • ^ Exponentiation
    • DIV Quotient
    • MOD Modulus
  • What are Boolean operators?
    • AND: Both conditions true
    • OR: Either condition true
    • NOT: Reverses outcome
  • What is a count-controlled loop?
    Repeats a loop a known number of times
  • What is a condition-controlled loop?
    Repeats until a certain condition is met
  • How would you write a For…Next loop to print "Hello World" 5 times?
    for i=1 to 5 print("Hello World") next i
  • How would you write a While…End While loop to print "Hello World" until counter reaches 5?
    while counter <= 5 print("Hello World") counter = counter + 1 endwhile
  • How would you write a Do…Until loop to print "Hello World" until counter reaches 5?
    do print("Hello World") counter = counter + 1 until counter > 5
  • What is required for the overall condition to be true in logical operations?
    Both conditions must be true.
  • What does the NOT operator do in comparisons?
    It reverses the outcome of a comparison.