True or false: A program can have valid syntax but still have incorrect semantics.
01. Introduction to Programming and Algorithmic Problem Solving Online Quiz Questions
Use this free practice quiz with 20 questions to review 01. Introduction to Programming and Algorithmic Problem Solving, test your knowledge, and prepare for your next test or exam.
Which example is an expression rather than a statement?
- A
2 + 3 - B
x = 2 + 3 - C
print(x) - D
if x > 0:
True or false: Binary search requires the input collection to be sorted.
- A
True
- B
False
What programming problem-solving process breaks a larger task into smaller operations?
A finite, ordered procedure for solving a problem is an .
In age = 21, what programming concept is represented by age?
- A
A data type
- B
A Boolean expression
- C
A variable
- D
An index
Which categories should a thorough test plan include? Select all correct choices.
- A
Normal cases
- B
Boundary cases
- C
Special cases
- D
Invalid cases
- E
Only cases with positive integers
How many times does this code print Repeat?
for count in range(3):
print("Repeat")
A named, reusable block of code that may accept inputs and return an output is a .
In an if/elif/else structure, what happens after one tested condition matches?
- A
Every branch whose condition is true executes
- B
Only the first matching branch executes
- C
Only the
elsebranch executes - D
Branches execute in reverse order
Which two measures are commonly used to evaluate an algorithm's resource use? Select all correct choices.
- A
Syntax complexity
- B
Time complexity
- C
Space complexity
- D
Name complexity
- E
Comment complexity
Explain a reliable workflow for turning a vague programming requirement into a tested and refined solution. Describe the purpose of the major stages and how they relate to one another.
Given colors = ["red", "green", "blue"], which element does colors[0] access?
- A
The second element
- B
The last element
- C
The first element
- D
An element chosen at random
Which statement correctly distinguishes decidability from efficiency?
- A
Decidability asks only whether an algorithm is fast
- B
Decidability asks whether a universally halting correct algorithm exists
- C
Decidability and efficiency are exactly the same question
- D
Efficiency determines whether every problem has an algorithm
True or false: An algorithm can be described in natural language or pseudocode, but a program must follow the formal rules of a programming language.
- A
True
- B
False
The following algorithm starts with the first item as the current largest and replaces it whenever a larger item is found. What value does it return for [7, 2, 10, 4]?
- A
4
- B
10
- C
7
- D
2
What is the single term for breaking a programming task into smaller operations, such as reading scores, calculating an average, comparing boundaries, and displaying a result?
A program runs until it attempts to divide by zero and then stops. Which category best describes this defect?
- A
Syntax error
- B
Logic error
- C
Runtime error or exception
- D
Efficiency problem
Which question is primarily about decidability rather than algorithmic efficiency?
- A
Whether an algorithm exists that always gives the correct answer and halts for every valid input
- B
Whether an algorithm uses less memory than another algorithm
- C
Whether a program has syntactically valid statements
- D
Whether a loop repeats a fixed number of times
A program must represent whether a user account is active or inactive. What data type is the most appropriate for this value?
Related study packs and tools
AP Computer Science A: Integrated Java Problem Solving
A practical review of the integrated Java skills, debugging habits, algorithm reasoning, and free-response strategies needed for AP Computer Science A.
Fault Tolerance and Redundant Systems
A progressive guide to designing, operating, and testing systems that continue useful service despite component faults, overload, data loss, and recovery challenges.
How the Internet Works
A medium-difficulty quiz on how independently operated networks, protocols, addresses, naming systems, transport services, and routing mechanisms work together to form the Internet.
Java ArrayList and Collections: Operations, Traversals, and Algorithms
Learn how to create, modify, traverse, and analyze Java lists with ArrayList, wrapper types, standard algorithms, and the Collections utility class for AP Computer Science A.
Java Boolean Logic and Selection
Build a clear understanding of Java Boolean expressions, logical operators, selection statements, nested branching, equivalent logic, and systematic code tracing for AP Computer Science A.
Java Foundations and Program Design
A practical introduction to Java program structure, data types, operators, input and output, problem-solving strategy, testing, and debugging for AP Computer Science A.
Java Inheritance and Polymorphism
A practical guide to Java inheritance, constructor chaining, method overriding, polymorphism, access control, and object behavior for tracing and writing AP Computer Science A programs.
Java Objects, Classes, and the String API
A focused guide to Java classes, object references, constructors, methods, strings, wrapper classes, and API usage for AP Computer Science A.
Java Primitive Types and Expression Evaluation
A focused guide to Java primitive types, expression evaluation, numeric conversion, floating-point behavior, integer overflow, and common methods in the Math class for AP Computer Science A.
Java Primitive Types and Expressions
A focused review of Java primitive types, expression evaluation, numeric conversion, arithmetic behavior, Math methods, randomness, and tracing techniques for AP Computer Science A.
Packets, Links, and Network Performance
A progressive guide to how packet-switched networks encapsulate data, move it across links, and manage delay, throughput, queues, and congestion.
Parallel and Distributed Computing
A structured guide to designing parallel and distributed systems through decomposition, communication, coordination, state management, scalability, and fault tolerance.