wayground logo

Free Printable Worksheets

NEW

Font size

S
M
L
XL
Worksheets

SDD HSC Quiz 5A Q1-10

Total questions: 10

Worksheet time: 5mins

Name
Class
Date
1.
A metalanguage is
a)
either an EBNF or railroad diagram.
b)
used to make sense of programming languages.
c)
another name for a high-level language.
d)
used to describe the syntax of another language.
2.
In EBNF {<thing>} means that <thing>:
a)
is repeated one or more times.
b)
is repeated zero or more times.
c)
is optional.
d)
can take on more than one value.
3.
Which of the following is true of multidimensional arrays?
a)
Data is stored in records.
b)
Each data item takes the same value.
c)
All data items are of the same data type.
d)
No two data items can have the same value.
4.
Declaring a user defined variable involves:
a)
Defining the data type then declaring the variable.
b)
Declaring the variable then defining the data type.
c)
Determining the number of indexes then declaring the variable.
d)
Opening the data type and then reading its contents.
5.
If RND generates a random number in the range 0 to less than 1. INT(RND*6)+4 would result in integers in the range:
a)
4 to 10.
b)
6 to 10.
c)
4 to 9.
d)
3 to 9.
6.
A multi-dimensional array requires 3 indexes and needs to store 1000 data items. Which Visual Basic statement achieves this task?
a)
DIM Test(10,10,10)
b)
DIM Test(9,9,9)
c)
DIM Test(999,999,999)
d)
DIM Test(400,300,300)
7.
A data structure containing a series of records could be:
a)
an array of records.
b)
a file.
c)
a multi-dimensional array.
d)
Both A and B.
8.

If a digit is defined in EBNF to be 1|2|3|4|5. A syntactically correct HiNum is:

a)

HELLO/1/2/1/BYE

b)

HELLO1232/BYE

c)

HELLO1/2/3/4BYE

d)

HELLO1/2/3/BYE

9.

A data structure is declared in Pascal using the following statements. Which of the following is correct?

a)

An array of records exists called ThisThat. It contains six data items.

b)

Each record of type ThisThat will contain six data items.

c)

A variable declared with type ThisThat will be an array with 3 records.

d)

A variable of type ThisThat will contain two records. Each record containing three fields.

10.

What is the purpose of the following fragment of Visual Basic code:

a)

A loop counts from 1 to 1000. 1000 random numbers are totalled. Each number is either a 0 or a 1.

b)

The number of 0s and the number of 1s generated is calculated for 1000 random numbers. Each random number can be either a 0 or a 1.

c)

One thousand 0s and 1s are generated. The total of all the 0s is stored in Total(0) and the total of all the 1s in Total(1).

d)

1000 random numbers from 0 to 1 are generated. Each number is added to the total after it is generated.