wayground logo

Free Printable Worksheets

Font size

S
M
L
XL
Worksheets

Test 1 Programming principles

Total questions: 68

Worksheet time: 2hrs 14mins

Name
Class
Date
1.

Which contains the physical devices that make up a computer?

a)

Hardware

b)

CPU

c)

Main memory

d)

Input device

e)

Output device

2.

Which is contained in the "box" of the computer?

a)

Hardware

b)

The central processing unit (CPU)

c)

The main memory

d)

Secondary storage devices

e)

Paloma

3.

Which of these includes (disc drives, CDs, DVDs, etc.)

a)

Paloma

b)

Perro

c)

Main memory

d)

Secondary storage devices

e)

The central processing unit (CPU)

4.

Which of these collects data people or other devices to use in the computer program that is running. Types include keyboards, mouse, scanner, microphone, digital cameras. Discs and optical drives can also be used as "input" as they hold the data being used in a computer program.

a)

Input devices

b)

Output devices

c)

The central processing unit (CPU)

d)

Hardware

e)

Main Memory

5.

Which of these devices are those that produce data and information for people or other devices, Printers and display units, plus discs and CDs, DVDs are output as well.

a)

Input devices

b)

Output devices

c)

Main memory

d)

The central processing unit(CPU)

e)

Hardware

6.

Which type of programing language is a programming language that is designed to be easy for humans to read and write. Ex. Java, JavaScript, Python.

a)

High-level languages

b)

Low-level languages

7.

Which type is a programming language that is designed to be easy for a computer to run; are hardware dependent.

a)

High-level language

b)

Low-level language

8.

What are 3 examples of low-level languages?

a)

machine language

b)

assembly language

c)

bytecode

d)

Python

e)

Java

9.

What are the two computer programs that translate high-level languages into machine language?

a)

Python

b)

Java

c)

Interpreters

d)

Compilers

e)

C++

10.

Which translates the entire source code completely before the program starts running?

a)

Compiler

b)

Interpreter

c)

Python

d)

Java

e)

C++

11.

Which translates a few lines at a time, runs those lines, and then alternates between translating source code and running the results.

a)

Compiler

b)

Interpreter

c)

Python

d)

Java

e)

C++

12.

Which of these are the rules you must follow when create the names of your variables?

a)

You can't use one of PYTHON's keywords

b)

A variable name cannot contain spaces

c)

The first letter MUST be one of the letters A-Z, a-z or the underscore (_) character

d)

After the first letter you may use the letters A-Z, a-z, digits 0-9 or the underscore

e)

Uppercase and lowercase characters are DIFFERENT. This means the variable name Age and age are NOT the same!!!

13.

There are only two values for a Boolean data type variable - True and False. Is this statement correct?

a)

Yes

b)

No

14.

Which is is a logical design of statements that controls the order in which a set of statements execute?

a)

Control structure

b)

Sequence structure

c)

A decision/selection structure

d)

None of the above

e)

All of the above

15.

Which structure is a set of statements that execute in the order that they appear?

a)

Control structure

b)

Sequence structure

c)

A decision/selection structure

d)

All of the above

e)

None of the above

16.

The purpose of the CPU is to retrieve memory and execute it.

a)

True

b)

False

17.

Which are typical major components for a computer?

a)

Central processing unit

b)

Main memory

c)

Secondary storage devices

d)

Input and output devices

e)

Ram

18.

All data in a computer is stored in sequences of 0s and 1s.

a)

True

b)

False

19.

Which of these is a line of code that performs a basic operation?

a)

Statement

b)

Method

c)

Class

d)

Package

e)

Comment

20.

Which of these is a named sequence of statements; should begin with lower case letters?

a)

Statement

b)

Method

c)

Class

d)

Package

e)

Comment

21.

Which of these is a named collection of methods; should begin with upper case letters.

a)

Statement

b)

Method

c)

Class

d)

Package

e)

Comment

22.

Which of these is a named collection of methods; should begin with upper case letters?

a)

Statement

b)

Method

c)

Class

d)

Package

e)

Comment

23.

Which of these are called notes to yourself and other programmers in the source code?

a)

Statement

b)

Method

c)

Class

d)

Package

e)

Comment

24.

Which of these are considered input devices?

a)

Keyboard

b)

Mouse

c)

Scanner

d)

Camera

e)

Car

25.

Which of these are considered output devices?

a)

Printer

b)

Video display

c)

Car

d)

Keyboard

e)

Mouse

26.

Which of these are programs that make a computer useful for everyday tasks?

a)

Application software

b)

System software

c)

Ram

d)

The central processing unit (CPU)

e)

Data software

27.

Which of these is a set of instructions that a computer follows to perform a task?

a)

Program

b)

RAM

c)

The central processing unit (CPU)

d)

Software

e)

Car

28.

What is a set of well-defined logical steps that must be taken to perform a task called?

a)

Algorithm

b)

Pseudocode

c)

Flowchart

d)

Input

e)

Output

29.

What would fake code be called?

a)

Package

b)

Pseudocode

c)

Strings

d)

Bug

e)

Syntax error

30.

What is a diagram that graphically depicts the steps in a program called?

a)

Flowchart

b)

Line chart

c)

Piechart

d)

Collum chart

e)

Area chart

31.

What is the first step in the program development life cycle?

a)

Design the program

b)

Write the code

c)

Interpret or compile your program

d)

Execute/Run the program

e)

Correct logic errors

32.

What is the second step in the program development cycle?

a)

Design the program

b)

Write the code

c)

Interpret or compile your program

d)

Execute/Run the program

e)

Correct logic errors

33.

What is the third step in the program development cycle?

a)

Design the program

b)

Write the code

c)

Interpret or compile your program

d)

Execute/Run the program

e)

Correct logic errors

34.

What is the fourth step in the program development cycle?

a)

Design the program

b)

Write the code

c)

Interpret or compile your program

d)

Execute/Run the program

e)

Correct logic error

35.

What is the fifth step in the program development cycle?

a)

Design the program

b)

Write the code

c)

Interpret or compile your program

d)

Execute/Run the program

e)

Correct logic errors

36.

What is a piece of prewritten code that performs an operation?

a)

Function

b)

Print function

c)

Argument

d)

Paloma

e)

Perro

37.

A sequence of characters that is used as data?

a)

True

b)

False

38.

A string literal is a string that appears in actual code of a program.

a)

True

b)

False

39.

Comments are notes of explanation within a program.

a)

True

b)

False

40.

An end-line comment appears at the end of a line of code.

a)

True

b)

False

41.

What is the name that represents a value stored in the computer memory?

a)

Variable

b)

Statement

c)

Comment

d)

Value

e)

Data

42.

What is data given to a function called?

a)

Argument

b)

Print

c)

Variable

d)

Statement

e)

Perro

43.

String literal must be enclosed in single (‘) or double (“) quote marks

a)

True

b)

False

44.

What is used to create a variable and make it reference data?

a)

Assignment statement

b)

Beginning statement

c)

Comment statement

45.

Which is used for the assignment operator?

a)

The equal sign (=)

b)

quotations("")

c)

A plus sign (+)

d)

Two backslashes (//)

e)

A minus sign (-)

46.

In the assignment statement, the variable receiving value must be on the left side.

a)

True

b)

False

47.

A variable can refer to item of any type.

a)

True

b)

False

48.

A garbage collection is the removal of values that are no longer referenced by variables.

a)

True

b)

False

49.

Which type of structure is the logical design that controls the order in which a set of statements execute?

a)

Control structure

b)

Sequence structure

c)

Decision structure

d)

Single alternative decision structure

e)

Single structure

50.

Which structure is a set of statements that executes in the order they appear?

a)

Control structure

b)

Sequence structure

c)

Decision structure

d)

Single alternative decision structure

e)

Single structure

51.

Which of these are expressions that evaluate to either true or false based on a comparison between two or more values. These expressions are used in if statements as well as in looping statements?

a)

Boolean expressions

b)

Conditional expressions

c)

Integral expressions

d)

Floating expressions

e)

Primary expressions

52.

Which operator determines whether a specific relationship exists between two values?

a)

Arithmetic Operators

b)

Bitwise Operators

c)

Identity Operators

d)

Rational Operators

e)

Membership Operators

53.

This would be true in Boolean expressions using rational operators for X being greater than y?

a)

x > y

b)

x < y

c)

x >= y

d)

x <=y

e)

x == y

54.

This would be true in Boolean expressions using rational operators for x is less than y?

a)

x > y

b)

x < y

c)

x >= y

d)

x <= y

e)

x == y

55.

This would be true in Boolean expressions using rational operators for x is greater than or equal to y?

a)

x > y

b)

x < y

c)

x >= y

d)

x <= y

e)

x != y

56.

This would be true in Boolean expressions using rational operators for x is less than or equal to y?

a)

x > y

b)

x < y

c)

x >= y

d)

x <= y

e)

x != y

57.

This would be true in Boolean expressions using rational operators for x is equal to y?

a)

x > y

b)

x < y

c)

x >= y

d)

x <= y

e)

x == y

58.

This would be true in Boolean expressions using rational operators for x is not equal to y?

a)

x > y

b)

x < y

c)

x >= y

d)

x >= y

e)

x != y

59.

When the if the statement executes, the condition is tested, and if it is true the block statements are executed. otherwise, block statements are skipped.

a)

True

b)

False

60.

>= and <= operators test more than one relationship.

a)

True

b)

False

61.

== the operator determines whether the two operands are equal to one another.

a)

True

b)

False

62.

!= the operator determines whether the two operands are not equal.

a)

True

b)

False

63.

Statements in an inner block must be indented with respect to the outer block.

a)

True

b)

False

64.

What is data values that can change when the user is asked a question called?

a)

Variables

b)

Strings

c)

Comment

d)

Class

e)

Package

65.

What is a programing error that causes it to operate incorrectly but not to terminate abnormally (Crash)

a)

Logic error

b)

Syntax error

c)

Valueerror Error

d)

Typeerror Error

e)

TypeError

66.

What is a group of statements within a program that performs a specific task called?

a)

Function

b)

Progarm

c)

Statement

d)

Block

e)

Header

67.

What is this program called where each task in a program is its own function?

a)

Modularized program

b)

Python Program

c)

Java Program

d)

C++ Program

e)

None of the above

68.

What type of function simply executes the statements it contains and then terminates called?

a)

Void function

b)

value-returning functions

c)

Built in functions

d)

Main Function

e)

Function header