0% found this document useful (0 votes)
6 views10 pages

Nc2410 - Principles of Computer Programming l3 p1 QP Nov 2022

This document is a question paper for the National Certificate (Vocational) in Principles of Computer Programming, NQF Level 3, dated 11 November 2022. It consists of various sections including multiple-choice questions, true/false statements, and programming-related questions, totaling 100 marks. The paper covers topics such as programming concepts, algorithms, database management, and file handling.

Uploaded by

dcee785
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
6 views10 pages

Nc2410 - Principles of Computer Programming l3 p1 QP Nov 2022

This document is a question paper for the National Certificate (Vocational) in Principles of Computer Programming, NQF Level 3, dated 11 November 2022. It consists of various sections including multiple-choice questions, true/false statements, and programming-related questions, totaling 100 marks. The paper covers topics such as programming concepts, algorithms, database management, and file handling.

Uploaded by

dcee785
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 10

NATIONAL CERTIFICATE (VOCATIONAL)

PRINCIPLES OF COMPUTER PROGRAMMING


(First paper)
NQF LEVEL 3

(10041023)

11 November 2022 (X-paper)


09:00–12:00

This question paper consists of 10 pages.

263Q1N2211

Copyright reserved Please turn over


(10041023) -2-

TIME: 2 HOURS
MARKS: 100

INSTRUCTIONS AND INFORMATION

1. Answer all the questions.

2. Read all the questions carefully.

3. Number the answers according to the numbering system used in this


question paper.

4. Start each question on a new page.

5. Use only a black or a blue pen.

6. Write neatly and legibly.

Copyright reserved Please turn over


(10041023) -3-

SECTION A

QUESTION 1

Various options are given as possible answers to the following questions. Choose the
correct answer and write only the letter (A–D) next to the question number (1.1–1.10) in
the ANSWER BOOK. 
1.1 Which of the following examples will determine the lowest available subscript
of an array?

A UBound
B LBound
C HBound
D SBound

1.2 A(n) … occurs when the result of a calculation is the lowest number that the
computer can actually represent in memory.

A overflow error
B
C
D
underflow error
conversion error
syntax error

1.3 An algorithm that traverses a list to match each item in the list against a search
item whose location is to be found.

A Linear search
B Binary search
C Jump search
D List search

1.4 Which combinations of the following statements (i–iv) about the Visual Basic
statement ReDim Preserve intArrMarks(10) are correct?

i The statement is a dimension statement.


 ii
iii
The Preserve keyword helps to preserve the existing data in the array.
Shows an example of a dynamic array.
iv Can only be used on single dimension arrays.

A i, ii
B
C
i, iii
ii, iii 
D iii, iv

Copyright reserved Please turn over


(10041023) -4-

1.5 Which combination of the following options are examples of events of the button
control?

i Click
 ii
iii
Move
Focus
iv Load

A i, ii, iii
B ii, iii, iv
C i, iii, iv
D i ii, iv

1.6 Which of the following data types is allocated 8 bytes of storage?

A Integer
B
C
Short
Decimal 
D Long

1.7 Math.Round(2.44) will produce an answer of … .

A 2.5
B 3
C 2
D 2.4

1.8 The comparison operator … checks whether the values of two operands are
equal or not; if values are not equal, then the condition becomes true.

A <>
 B
C
=
>=
D <=

1.9 The VB.NET class … is used to read from and write to any location in a file.

A directorystream
B binarystream
C filestream
D memorystream

1.10 An intersection table is a table that defines a … relationship.

A one-to-one
B
C
one-to-many
many-to-one 
D many-to-many
(10 × 1) [10]

Copyright reserved Please turn over


(10041023) -5-

QUESTION 2

Indicate whether the following statements are TRUE or FALSE. Choose the answer and
write only 'True' or 'False' next to the question number (2.1–2.10) in the ANSWER
BOOK. 
2.1 A Sub procedure must always specify a return datatype.

2.2 The VB.Net String function Len() returns an integer that contains the number
of characters in a string.

2.3 A foreign key is a field in a table which uniquely identifies each row/record in a
database table.

2.4 The File.Exists function returns a Boolean value of either true or false.

2.5 The For ... Next loop runs a set of statements once for each element in

2.6
an array.

A Do loop allows one to test a condition at either the beginning or the end of a
loop structure.

2.7 A validation rule is one method of restricting input in a field in an MS Access


database table.

2.8 The square brackets [ ] are used when initialising an array in VB.Net.

2.9 The IsNumeric() function returns a Boolean value that indicates whether a 
specified expression can be evaluated as a decimal number.

2.10 An example of a local variable is a variable declared inside a Sub or Function.


(10 × 1) [10]

QUESTION 3

Complete the following sentences by writing only in the missing word or words next to
the question number (3.1–3.5) in the ANSWER BOOK.

3.1 … errors are those types of errors that appear only after one compiles and
debugs code.

3.2 An SQL … clause is used to combine rows from two or more tables, based on
a related column between them.

3.3 The last digit of a South African ID number is calculated using the Luhn … .

3.4 One can modify and edit an MS Access report in … view.


Copyright reserved Please turn over
(10041023) -6-

3.5 The standard naming convention prefix for naming a form is … .


(5 × 1) [5]

TOTAL SECTION A: 25

SECTION B

QUESTION 4

4.1 Study FIGURE 1 below and answer the questions the follow.

FIGURE 1: COMBINATIONAL LOGIC GATE

4.1.1 Determine the Boolean expression for the logic gate given above.

4.1.2 Simplify the Boolean expression in QUESTION 4.1.1. 


(2 × 2) (4)

4.2 Determine the TWO’s complement for the following numbers.

4.2.1 -1710.

4.2.2 -1110

4.2.3 -12310
(3 × 2) (6)
 [10]

Copyright reserved Please turn over


(10041023) -7-

QUESTION 5

5.1 Study the following snippet of a flowchart and answer the questions that follow.

5.1.1 Create appropriate VB.NET statements to represent the flowchart


 snippet above by using a For Next loop structure.

NOTE: Assume that the datatype of variables COUNT and SUM are
whole numbers that need to be declared. (6)

5.1.2 Differentiate between a For Next loop and a Do loop. (3 × 2) (6)

5.1.3 Explain ONE reason why infinite loops are considered bad
programming practice. (2)

5.2 Provide a reason for the use of EACH of the following structures in VB.NET:

5.2.1 GotFocus event

5.2.2 Select Case statement

5.2.3 I P O diagram 
5.2.4 Naming conventions for datatypes

5.2.5 Masked textbox


(5 × 1) (5)

Copyright reserved Please turn over


(10041023) -8-

5.3 Study FIGURE 2 below and answer the questions that follow.

FIGURE 2: DO LOOP

5.3.1 Explain the differences between a pre-test and a post-test loop.


(2 × 2) (4)
[23]

QUESTION 6

6.1 Define the following programming structures in the context of file handling:

6.1.1 EOF function

6.1.2 CSV file

6.1.3 File path 


6.1.4 File.Exists function

6.1.5 BinaryWriter
(5 × 2) (10)

6.2 Study the following snippet of code and answer the questions that follow.

6.2.1 Briefly describe the purpose of an array. (1)



Copyright reserved Please turn over
(10041023) -9-

6.2.2 Identify the type of single dimension array declared in line 1 and line
4 respectively. (1)

6.2.3 Explain ONE reason why a two-dimensional array is different from a


 one-dimensional array. (2)

6.2.4 Identify TWO other VB.Net statements that are commonly used
together with the type of array identified in QUESTION 6.2.2.(1 × 2) (2)

6.2.5 Identify the subscript value for the strArrSpokLang() array that will
yield a result of “Sesotho”. (1)

6.2.6 Identify the subscript value for the strArrCompLang() array that will
yield a result of “VB.Net”. (1)

6.2.7 Identify the UpperBound of both arrays. (2)

6.2.8 Explain the purpose of the curly brackets used in line 1 and line 4
respectively. (2)
[22]

QUESTION 7

7.1 uKhahlamba Tours uses custom designed software that has been developed
to keep track of all their tours in a central database.
A snippet of one of the tables in the database named ToursInfo that is used to
store information on the different tours and clients is shown in FIGURE 3 below.

FIGURE 3: ToursInfo database table

7.1.1 The database table shown above has no primary key defined.

(a) Explain the purpose of a primary key. (2)


 (b) Identify an appropriate field that can be used as a primary
key. (1)

(c) Explain the purpose of a foreign key. (2)

(d) Identify a field that can be used as a foreign key. (1)


Copyright reserved Please turn over
(10041023) -10-

(e) Define the term, composite primary key.  (2)

(f) Suggest a suitable prefix that can be used when naming


an MS Access database table. (1)

7.1.2 The general properties for the SurnameClient1 field are shown in
FIGURE 4 below.

FIGURE 4: SurnameClient1 properties



(a) Explain what it means to specify a field size of 25 for this
field. (2)

(b) Explain the purpose of a validation rule in an MS Access


 table. (2)

(c) Determine whether the validation rule applied to this field


is suitable. (1)

(d) Give TWO reasons for your answer in


QUESTION 7.1.2 (c). (2)

(e) Explain the purpose of the Required property. (2)

(f) Explain ONE way in which an Input Mask can be applied


to this field. (2)
[20]
 TOTAL SECTION B: 75
GRAND TOTAL: 100

Copyright reserved

You might also like