MS EOT3 Grade 8

You might also like

Download as pdf or txt
Download as pdf or txt
You are on page 1of 4

End of Term 3 Assessment

Grade: 8

Subject: Computer Science

Name: Total Marks: ___________/ 40

Teacher: Duration: 1 hour

Exam Instructions:

● Write your name and your teacher’s name in the box above.
● Read each question carefully before you start to answer it.
● Answer all questions.
● The marks for each question are shown in brackets.
- Use this as a guide as to how much time to spend on each question.

Answer ALL questions. Write your answers in the spaces provided.

1. (i) • Both can use arguments / parameter passing (1)

• Both can use local variables (1)

• Both can be called from anywhere within the program (1)

• Code can be reused without being rewritten (1)

• Both can be library files (1)

• The code can be independently tested for both (1)

(ii) A function must always return a result (1) whereas a procedure does not (1)

• A function interface must have a data type (1) to signify the type of data that
will be returned / a procedure does not need this (1)

• The result of a function must always be used (either assigned to a variable or as


part of a condition) (1) whereas a procedure does not explicitly return a result to
be used (1)

• A function produces information (1) whereas a procedure performs a task (1)

1
2.

Draw your flowchart here

3.

2
5.

a. Write the output of the algorithm if the INPUT is 65. (1)

OUTPUT = C

------------------------------------------------------------------ ---------------------

b. Write the output of the algorithm if the INPUT is -1 (1)

ERRONEOUS DATA/ ERROR MESSAGE

---------------------------------------------------------------------------------------

c. Give an input to DISPLAY a grade ‘D’. (1)


INPUT IS BETWEEN 1 , 59

---------------------------------------------------------------------------------------------------------------------

3
6. (2)

Local variable - a variable that is accessed only from within the subprogram in which it
is created.

global variable : a variable that can be accessed from anywhere in the program,
including inside subprograms

7. (2)

(a)

(3)

(b)

8.

(6)

You might also like