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
What programming concept allows a single function name to behave differently based on the number or type of arguments?
Answer: Function overloading
Function overloading allows multiple functions to share the same name but differ in parameter count or types.
A loop that never terminates because its exit condition is never met is called a(n):
Answer: Infinite loop
An infinite loop runs indefinitely because the terminating condition is either never reached or never becomes false.
Which of the following is NOT a characteristic of an algorithm?
Answer: Ambiguity
Algorithms must be unambiguous; each step must be precisely defined, making ambiguity an anti-characteristic.
What keyword is commonly used to exit a loop prematurely in most programming languages?
Answer: break
The 'break' statement immediately terminates the innermost loop and transfers control to the statement after it.
Which data type is used to store a sequence of characters in most programming languages?
Answer: String
A string data type stores a sequence of characters, such as words or sentences.
What is the purpose of a 'sentinel value' in a loop?
Answer: To act as a special value that signals the end of input
A sentinel value is a designated special input that signals the loop to stop processing when encountered.
In a truth table for a two-input AND operation, how many rows produce a TRUE output?
Answer: 1
Only the row where both inputs are TRUE (TRUE AND TRUE) produces a TRUE output; all other combinations yield FALSE.