NEW
Font size
WorksheetsProgramming & Logic Cumulative Review
Total questions: 35
Worksheet time: 18mins
Which control structure repeats a set of instructions until some condition is met?
Object
Loop
Sequence
Selectiion
Using short informal phrases to describe program functions (such as "if total is more than 10, add discount") is called:
formatting.
flow charts.
pseudocode.
logical thinking.
What enables a programmer to determine the order in which instructions are executed, as well as the number of times (or even if) an instruction is executed?
program flow
control structures
program syntax
logic structures
Greg is interested in computer programming languages, but he has very little experience in using them. Which type of programming language should he explore because it is easier to learn, use, read and modify?
Machine
Application
High-level
Assembly
Which term describes a set of instructions that lists steps that must be followed in a particular order, starting at the beginning and continuing to the end?
Assembly
Sequential
Selection
Iteration
Consider the general problem-solving steps shown. Which option lists the problem-solving steps in the correct order?
4, 2, 1, 3
1, 2, 3, 4
4, 1, 3, 2
2, 1, 4, 3
Julie has an idea. She wants to use a computer to create a list of daily "to-do" suggestions based on the previous activity on her calendar. To create this, she needs to develop a set of instructions to tell the computer what to-do to accomplish this task. This is known as:
a flowchart.
an algorithm.
a computer program.
a programming language.
Which variable data type is used to store a whole number that does not contain a decimal?
Boolean
Integer
String
Floating point
Basic mathematics taught in elementary school is a base 10 number system (which makes it easy if you are using your fingers). Computers use a different number system, known as:
base 6.
base 8.
base 1.
base 2.
What is the only language a computer can understand?
High-level
Assembly
Machine
Application
Which term describes a series of zeroes and ones that represent the basic unit of data that a computer processes?
code
switch
data
byte
During testing, your development team identified some problems in the first program draft. What is the next step you need to complete?
test the plan
review the result of the solution
revise the plan until a solution is found
use logic to plan a solution
Which type of programming is designed by breaking problems into smaller, logical problems to make them easier to execute?
functional
structured
scripting
object-oriented
Devising a plan to solve a problem or perform a task using a set of step-by-step instructions is called:
running a program.
interpreting instructions.
creating syntax.
writing an algorithm.
Which type of programming error causes a program to stop loading or executing?
runtime
logic
syntax
system
Which of the following is used to store data in the computer's memory that the computer can access and use when running a program?
variable
file
data
operator
Computers organize the zeroes and ones that represent an instruction into a series of eight pieces. This series of eight ones or zeroes is known as:
data.
a bit.
code.
a byte.
Variables can hold different types of data, and they are classified based on the type of data they hold. The numbers 7.5, 2.1 and 48.6 would be stored using which variable data type?
integer
string
floating point
Boolean
Consider the following:
- Input a number
- Check to see if the number ends in 0, 2, 4, 6 or 8?
- If yes, write "The number is even."
- If no, write "The number is odd."
This is an example of which type of control structure?
sequence
iteration
loop
selection
Which statement is true about objects?
Objects created using the same class may contain different properties; however, the properties must contain the same values.
Objects created using the same class must contain the same properties; however, the properties may contain different values.
Objects created using the same class can contain different properties and property values.
Objects created using the same class must contain the same the same properties and property values.
Which control structure includes the do/while statement?
object
selection
sequential
loop
Alex and his team are given a mission to create a program that finds the average age (in the total days, not years) of the students at their school. What should be their first step for creating an algorithm to solve the problem?
test and refine the solution
determine the logic needed to plan a solution to the problem
identify and understand the problem
create the procedures needed to execute the solution
Eric is using object-oriented programming to design a game. He has created a Dragon class, and he has used the Dragon class to build two Dragon objects. Which term describes the objects that Eric built using the Dragon class?
instances
subclasses
occurrences
methods
Cara has added the variable names needed by her program. She must now assign an initial value to each variable. What is the term for assigning this initial value?
initializing
encoding
declaring
executing
Consider the loop control structure in programming. Which term describes a loop that continues repeating without a terminating (ending) condition?
unlimited loop
infinite loop
sequence loop
conditional loop
Which operator is an example of a Boolean operator?
++
II
!=
%
Which type of error occurs when a programmer misspells a word or instruction?
syntax
system
runtime
logic
Which type of statement is an example of a selection programming structure?
do while
for
if/else
while
What is the process that a programmer uses to identify errors and make corrections to a program that does nor perform the way it was intended or produces incorrect results?
debugging
compiling
testing
executing
You are designing a computer program that calculates the amount of change a customer should receive. You create a program design document using the following pseudocode to demonstrate the program flow:
item1 = input cost of item 1
item2 = input cost of item 2
item3 = input cost of item 3
total = item1 + item2 + item3
amtPaid = input amount paid
change = ________________
Notice the blank at the end of the program. Which expression correctly completes the blank?
total - amtPaid
amtPaid - total
amtPaid * item1 + item2 + item3
item1 + item2 + item3 - amtPaid
Veronica has written a computer program that locates records in a database. During testing, the program suddenly stops running. What is most likely causing the program to stop running?
a debugging error
a runtime error
a syntax error
a logic error
John has tried to run his program, but an error has occurred. He looks closely at the code and realizes there are several misspelled instructions. What type of error did John's spelling mistakes create?
syntax
system
runtim
logic
Raphael is asked in his programming class to describe a benefit of structured programming. Which of the following would the best response for Raphael to give?
It has the same structure and set of commands as machine language but uses symbols and recognizable codes.
It divides the problem into smaller, more manageable tasks that are performed in a sequence to solve the larger problem.
It focuses on classes and objects that can be reused and changed.
It is a set of rules for defining how declaration, functions, commands and other statements should be arranged in a computer program.
Carrie is using object-oriented programming to code her latest video game. In the game, she has objects that are little monsters. Each is unique in their own way (size, color, etc.). To create each of these unique looking objects, she needs to change the:
properties.
classes.
methods.
arguments.
What are the three main programming structures?
machine, assembly, high-level
Java, Pythn, Visual Basic
sequence, selection, loop
structured, object-oriented, procedural
