WorksheetsUcertify Programming and Logic Review
Total questions: 40
Worksheet time: 1hrs 2mins
Mario has begun learning a programming language. He thought that he would write the code in plain English. However, programming languages require that he learn and follow a special set of rules referred to as:
syntax.
machine language.
assembly.
executing.
Computers organize the zeros and ones that represent an instruction into a series of eight pieces. This series of eight ones or zeros is known as:
data.
byte.
code.
a bit.
Consider the following code:
turnRight ();
for (var count = 0; count < 5; count++) {
moveForward ();
}
assembly language.
programming language.
computer language.
machine langugage.
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 2
base 1
base 8
base 6
Frank has written code for his video game that makes the character move to the left while the player presses the left-arrow key. Which type of control structure is this?
Selective
Functional
Object
Loop
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 Structure
Program syntax
Logic Structure
What are the three main programming structures?
Sequence, selection, loop
Structured, object-oriented, procedural
Machine, assembly, high-level
Java, Python, Visual Basic
Sylvia creates a program that asks and stores a user's name. It then displays the user's name every time there is a new prompt for the user to complete. What is used to store the name in the computer's memory that the computer can access and manipulate, when running Sylvia's program?
Variable
File
Data
Operator
Romina wants to input whole numbers (that do not contain a decimal) into variables in the inventory program she is coding. What variable data type should she use?
Floating point
String
Boolean
Integer
Charles is coding a role-playing game. He has created code that asks a player for their name and assigns it to the "name" variable. Charles assigns the first value for the variable as Player1 until a player inputs their information. What is the term for assigning this value for the "name" variable?
Encoding
Declaring
Executing
Initializing
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:
arguments.
properties.
classes.
methods.
Sean does not understand the relationships between objects, values, properties and classes. His technology teacher explains:
objects created using the same class may contain different properties; however, the properties must contain the same values.
objects created using the same class can contain different properties and property values.
objects created using the same class must contain the same properties and property values.
objects created using the same class must contain the same properties; however, the properties may contain different values.
Kiera is writing the code for a new video game. She is creating a character who waves to other characters. Every time the game player says "hello" to the character (by pressing the "H" key), the character waves back. The code to make the character wave is very long, so Kiera decides to name the segment of code WAVE. Now every time she needs the wave series of code she simply inputs WAVE. What has Kiera created?
A function
An instance
A iteration
An object
Mason is programming a robot that will use a sensor to follow a black line on a white floor. Which type of expression will he use for the black or white sensor that will return results in the value of either true or false?
Boolean
Selection
Concatenation
Conditional
Consider this recipe algorithm:
Preheat oven to 375 degrees
Grease and flour a cake pan
Add the next ingredient to the large bowl
Stir the contents of the bowl until blended
Pour the batter into the cake pan
Bake 30 minutes
Which instruction in this algorithm would be considered a loop structure?
Bake 30 minutes
Preheat oven to 375 degrees
Pour the batter into the cake pan
Add the next ingredient to the large bowl
Explanation
During testing, your development team identified some problems in the first program draft. What is the next step you need to complete?
Review the result of the solution.
Test the plan.
Use logic to plan a solution.
Revise the plan until a solution is found.
Consider this example:
if <this is true>
do this
else
do something else
a compiler
a flowchart
syntax.
pseudocode.
Lucy is sharing her program with a student at another school. She is having a video conference with the students and shows a section of code that she is working on. Lucy describes it as the decision control structure. The other student is confused. What other name can this structrure be called?
Object
Selection
Sequence
Loop
Which program translates a number of programs instructions, waits for computer to execute them, and then translates the next series, until the program is fully executed?
Assembler
Compiler
Application
Interpreter
The robotics team has created a solid design that can physically accomplish all of their tasks for competition. Now they must create the program that will control the robot. The code could be massive, and be difficult for them to write and for the computer to execute. They decide to break problems into smaller, logical problems to make them easier to execute. Which type of programming is this?
Structured
Scripting
Object-oriented
Functional
Mr. Simmons asks the class to create an algorithm to find out if each number on a list is odd or even. Peter creates a flowchart to help visualize his algorithm. The first step is to select a number from the list. What is the next logical step to solve the problem?
Multiply the selected number by two.
Divide the selected number by two.
Divide the number of items remaining on the list by two.
Count the number of items in the list.
Using short informal phrases to describe program functions (such as "if total is more than 10, add discount") is called:
pseudocode
flow charts.
formatiing.
logical thinking.
Aaron would like to create a program that allows the user to find the average of five numbers. He has asked for your help. Below is the pseudocode Aaron has written:
Enter five numbers
Add the numbers entered
Multiply the sum of numbers entered by 5
display the result
the program will provide the correct answer.
the program needs to provide the five numbers to the user.
the program needs to multiply the five numbers entered, not added.
the program needs to divide the sum of the numbers entered by 5, not multiply.
Melissa is testing a new video game for her roommate. She is playing the game and gets to the door at the end of the first level. As she opens the door, the game just stops running. What is most likely causing the game to stop?
A debugging error
A logic error
A syntax error
A runtime error
Scott has written a program to add together a group of numbers and then divide the total by the number of items added to produce the average value. When he tested the program, he noticed that the program is multiplying the total by number of items, not dividing as he intended. Which type of programming error has mostly likely occurred?
Computer
Logic
Runtime
System
Luigi has created a program for a game that has a "monster" character appear from a "cave" in the middle of the screen, move randomly off the edge of the screen and then reappear in the cave. It repeats while the game is played. What is another term for this loop control structure?
Object
Selection
Iteration
Sequence
Amber is programming a robot with a color sensor to follow a black curvy line on a white floor. She has programmed the robot to move forward, curving to the left if it senses black on the floor, and curving right if it does not sense black. She is hoping this will allow the robot to follow the black line. Which type of control structure has Amber written?
Functional
Selection
Sequence
Loop
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?
Control Stucture
Logic structures
Program Flow
Program Syntax
Consider the loop control structure in programming. Which term describes a loop that continues repeating without a terminating (ending) condition?
Sequence Loop
Unlimited Loop
Infinite Loop
Conditional Loop
Which type of control structure includes a set of instructions that the computer follows one by one from top to bottom.
Loop
Selection
Sequence
Algorithm
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?
Data
Variable
File
Operator
The program that Mauricio is creating to track his allowance, must store and access variables in the form of dollars and cents. Which variable data type should he use to store numbers that contain a decimal?
Floating point
Boolean
String
Integer
Chris must use a Boolean operator in his programming class assignment. Which operator is an example of a Boolean operator?
++
!=
&&
%
You have written a segment of code that includes the instructions to make a character jump. Your program will need to use these instructions multiple times. To save yourself the trouble of writing the code over and over again, you decide to name this section of code JUMP and then call the section of code using only the name JUMP. What type of programming component is JUMP?
A function
A property
A object
An instance
Which statement is true about objects?
Objects created using the same class must contain the same properties and property values.
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.
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:
methods.
arguments.
properties.
classes.
Which operator is an example of a Boolean operator?
%
++
!-
ll
Which variable data type is used to store a whole number that does not contain a decimal?
Boolean
Integer
String
Floating point
Which type of statement is an example of a selection programming structure?
while
if/else
for
do while
Which term is also used to describe the selection control structure?
Loop
Sequence
Object
Decision
