โ† All CPA Flashcard Decks

Programming Fundamentals & Logic Flashcards

7 cards from real CPA practice questions. Tap to flip, then mark Knew It or Still Learning โ€” missed cards come back until you master them.

Read the first 7 Programming Fundamentals & Logic flashcards as text
  1. Which type of error occurs when a program compiles successfully but produces incorrect results at runtime?

    Answer: Logic error

    A logic error means the program runs without crashing but produces wrong output due to a flaw in the algorithm.

  2. An algorithm that divides a problem into smaller subproblems of the same type and solves them recursively is using which strategy?

    Answer: Divide and conquer

    Divide and conquer breaks a problem into smaller instances of itself, solves each recursively, and combines the results.

  3. What value does an uninitialized boolean variable typically hold by default in strongly-typed languages?

    Answer: FALSE

    In most strongly-typed languages, boolean variables default to FALSE when declared but not explicitly initialized.

  4. Which control structure is most appropriate when you need to execute a block of code at least once before checking a condition?

    Answer: do-while loop

    A do-while loop executes its body first, then checks the condition, guaranteeing at least one execution.

  5. What is the purpose of a flowchart in programming?

    Answer: To visually represent the steps and logic of an algorithm

    A flowchart uses standardized symbols to graphically depict the flow of logic and decision-making steps in an algorithm.

  6. If a function calls itself within its own definition, it is known as a:

    Answer: Recursive function

    A recursive function is one that calls itself as part of its own execution to solve a problem.

  7. Which of the following is an example of a relational operator?

    Answer: >=

    The >= (greater than or equal to) operator is a relational operator used to compare two values.