wayground logo

Free Printable Worksheets

NEW

Font size

S
M
L
XL
Worksheets

Programming and Logic

Total questions: 25

Worksheet time: 50mins

Name
Class
Date
1.

Haruto is a high school student who has never taken a programming course. He wants a programming language that is easy to learn, that contains English words and phrases, as well as easily recognized symbols. The counselor recommends a Javascript course. What type of programming language is this?

a)

Assembly Language

b)

High-Level Language

c)

Application Language

d)

Machine Language

2.

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?

a)

Assembly

b)

Compiled

c)

Executed

d)

Sequential

3.

Maryann is writing a set of instructions to determine whether a number is even or odd. She divided the problem into smaller, easier steps, as shown:

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."

Which programming approach is Maryann using?

a)

Object-Oriented

b)

Scripting

c)

Functional

d)

Structured

4.

Horatio 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?

a)

Assembly

b)

High-Level

c)

Application

d)

Machine

5.

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?

a)

Variable

b)

File

c)

Data

d)

Operator

6.

Which type of programming error causes a program to stop loading or executing?

a)

Syntax

b)

System

c)

Runtime

d)

Logic

7.

Which term is also used to describe the selection control structure?

a)

Loop

b)

Decision

c)

Object

d)

Sequence

8.

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?

a)

Program Syntax

b)

Logic Structures

c)

Program Flow

d)

Control Structures

9.

Using short informal phrases to describe program functions (such as "if total is more than 10, add discount") is called:

a)

Logical Thinking

b)

Pseudocode

c)

Flow Charts

d)

Formatting

10.

Which term describes the testing method used by programmers to work through program code by hand using a pencil and paper?

a)

Real-Time Testing

b)

Desk Checking

c)

Error Testing

d)

Syntax Checking

11.

Which type of programming is designed by breaking problems into smaller, logical problems to make them easier to execute?

a)

Scripting

b)

Structured

c)

Functional

d)

Object-Oriented

12.

Which variable data type is used to store a whole number that does not contain a decimal?

a)

Boolean

b)

Floating Point

c)

String

d)

Integer

13.

Which of the following best defines the term "algorithm"?

a)

A combination of zeroes and ones that represents an instruction to the computer

b)

The rules for writing instructions in a specific programming language

c)

A way to write programming code in short English phrases to describe the program components

d)

A set of step-by-step instructions to solve a problem or perform a task

14.

Aaron would like to create a program that allows the user to find the average of five numbers. He has asked for your help. Here is the pseudocode Aaron has written:

After examining the code, you determine that:

a)

the program needs to multiply the five numbers entered, not add.

b)

the program needs to provide the five numbers to the user.

c)

the program will provide the correct answer.

d)

the program needs to divide the sum of the numbers entered by 5, not multiply.

15.

Julia 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)

a programming language

b)

a flowchart

c)

an algorithm

d)

a computer program

16.

Consider the following code. The instruction code shown is an example of high-level:

a)

assembly language

b)

machine language

c)

computer language

d)

programming language

17.

Which term describes the various characteristics of an object, such as size, color and type?

a)

Class

b)

Property

c)

Method

d)

Argument

18.

Which term describes a series of zeros and ones that represent the basic unit of data that a computer processes?

a)

Code

b)

Switch

c)

Data

d)

Byte

19.

Elsa is programming a robot to move from her front door to her room. The robot will not be remote controlled and does not have any sensors to "see" its environment. She must program the robot with clear movements that start at her front door, then move down the hall, then turn into her room and finally stop. Which term describes this program?

a)

Compiled

b)

Assembly

c)

Binary

d)

Sequential

20.

Consider the following example:

Problem: Tara has 15 tickets. Dean has 10 tickets. Tara gives Dean 2 tickets. How many more tickets does Tara have than Dean?

Solution:

Tara's tickets: 15

Subtract 2 tickets from Tara's total tickets:

15- 2 = 13

Dean 's tickets: 10

Add 2 tickets to Dean's tickets:

10 + 2 = 12

Subtract Tara's total tickets from Dean's total tickets:

13 - 12 =1

Answer: Tara has one more ticket than Dean.

Which term describes the instructions presented in this example?

a)

Algorithm

b)

Syntax

c)

Statement

d)

Programming Code

21.

Which term is used to describe the use of zeroes and ones in a sequence to represent data?

a)

Execute

b)

Decimal

c)

Binary

d)

Syntax

22.

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?

a)

Structured

b)

Scripting

c)

Object-Oriented

d)

Functional

23.

Jackson is creating a program that asks users four random questions. The question list is 20 questions long. He wants the program to ask the first random question, remove it from the list, and then ask another, remove it and repeat until only four questions are asked. Which control structure is Jackson using?

a)

Object

b)

Selective

c)

Sequence

d)

Loop

24.

Which term describes the testing method used by programmers to work through program code by hand using a pencil and paper?

a)

Desk Checking

b)

Error Testing

c)

Syntax Checking

d)

Real-Time Testing

25.

Using short informal phrases to describe program functions (such as "if total is more than 10, add discount") is called:

a)

Formatting

b)

Flow Charts

c)

Pseudocode

d)

Logical Thinking