wayground logo

Free Printable Worksheets

Font size

S
M
L
XL
Worksheets

1.4 principles of programming

Total questions: 17

Worksheet time: 13mins

Name
Class
Date
1.

Each line of high level language equates to ______ ______ of machine code

(a)  

2.

A situation that would require the use of a low level language is:

a)

Device drivers

b)

using long and meaningful identifiers

c)

writing a module that can be reused.

d)

using a mark-up language

3.

what programming paradigm uses classes?

a)

procedural

b)

visual

c)

object-oriented

d)

mark-up

4.

A class is a programming (a)   for creating objects

5.

Backus-Naur form is used to

a)

describe the operating system in a computer

b)

decode assembly instructions

c)

describe unambiguously the syntax of a programming language

d)

describe the instructions for a particular chip set

6.

Which of these pictures shows recursion in BNF form?

a)
b)
c)
d)
7.

This symbol ::= in Backus-Naur form means:

a)

OR

b)

AND

c)

is defined by

d)

is equal to

8.

An advantage of using a procedural language to write a program based on an algorithm is:

a)

is more modular than an object-oriented language

b)

allows the programmer to wait for an event before activating a procedure.

c)

can be used to create a web page.

d)

Allows the programmer to define precisely each step when performing a task

9.

Final output values in Backus-Naur are called

(a)  

10.

OR in Backus-Naur is written as

a)

|

b)

¬

c)

::=

d)

::

11.

Assuming digit and letter have been defined as above. How would you define in BNF a name that is made up of uppercase letters. The name could be any length.

(a)  

12.

using the variable digit that is already defined. Define a variable using BNF called 3digit that represents a number within the range 0-999.

Do not include spaces.

(a)  

13.

A method defined inside a class

a)

defines an object's attributes

b)

defines an object's behaviour

c)

creates an instance of the class

d)

Would create an error.

14.

encapsulation

a)

Methods are inherited from the parent class

b)

a function within a function to create a namespace.

c)

technical implementation is hidden within the object

d)

variables are all global

15.

A natural language interface

a)

Lets 2 computers communicate using spoken language

b)

Is a low level way of communicating with a computer

c)

Is a way of creating a computer generated voice

d)

Lets you communicate with a computer in your everyday language.

16.

In a non-procedural language you specify the results you want without specifying how to solve the problem

a)

True

b)

False

17.

A high level language must be unambiguous

a)

So that there are no grey areas.

b)

So that there are many ways to interpret each programming statement.

c)

so that there is only one way to interpret each program statement.

d)

So that the programmers can express functions correctly