You are on page 1of 8

ACADEMIC YEAR 2024

FIRST MIDTERM EXAMINATION


GRADE 8 – COMPUTER SCIENCES

NAME: …………………………………………………… DATE: ……………

PARENT’S SIGNATURE: ………….……………….... SCORE: ……… /80

TIME: 1 hour 45 minutes

READ THESE INSTRUCTIONS FIRST

• Answer all questions.


• Write your answer to each question in the space provided.
• You should pay attention to punctuation, spelling and handwriting.

INFORMATION
• The total mark for this paper is 75.
• The number of marks for each question or part question is shown in
brackets [ ].
• Suggestions for how long to spend on each section are given in the
booklet.
1. What do you understand by programming language? [1]
………………………………………………………………………………………
………………………………………………………………………………………
………………………………………………………………………………………
……………………………………………………………………………………….

2. How many types of computer language did you study? [4]


………………………………………………………………………………………
………………………………………………………………………………………
………………………………………………………………………………………
……………………………………………………………………………………….

a. What does high level language mean?


………………………………………………………………………………………
………………………………………………………………………………………
………………………………………………………………………………………
……………………………………………………………………………………….

b. What is a low level language?


………………………………………………………………………………………
………………………………………………………………………………………
………………………………………………………………………………………
……………………………………………………………………………………….

3. Write down the types of language C that you havelearned? [1]


………………………………………………………………………………………
………………………………………………………………………………………
………………………………………………………………………………………
……………………………………………………………………………………….

4. Explain the difference between high level language and low level
language [1]
……………………………………………………………………………………………
……………………………………………………………………………………………
……………………………………………………………………………………………
……………………………..
5. Describe what an interpreter and a compiler do. [1]
……………………………………………………………………………………………
……………………………………………………………………………………………
……………………………………………………………………………………………
……………………………..

6. What is the base of binary system, denary and hexadecimal? [3]


……………………………………………………………………………………………
……………………………………………………………………………………………
……………………………………………………………………………………………
……………………………..

7. Write down the language that a computer understands [2]


……………………………………………………………………………………………
……………………………………………………………………………………………
……………………………………………………………………………………………
……………………………..

3. Choose the correct answers. [8]


a). Compiler has several advantages:

i. Compiled program runs quickly, since it has already been translated.


ii. A compiled program can be supplied as an executable file. An
executable file is a file that is ready to run. Since an executable file
cannot be easily modified, programmers prefer to supply executable
rather than source code.
iii. Additionally, the program has to be translated every time it runs.
iv. Compiler optimizes code. Optimized code can run quicker and take up
less memory space.

b). Compiler has several disadvantages:


i. Because the source code is translated as a whole, there must be
enough memory space to hold the source code, the compiler and
the generated object code.
ii. There also needs to be temporary working space for the compiler
to perform the translation. Modern systems either have enough
memory or use virtual memory to hold all the data.
iii. Since instructions are executed once translated, they are not
stored for later use. As a result, interpreters require less available
memory.
iv. Compilers do not usually spot errors-the program has to be
compiled and run before errors are encountered. This makes it
harder to see where the error lies.
v. Errors can be quickly spotted – once an error is found, the
program stops running and the user is notified at which part of the
program the interpretation has failed. This makes interpreters
extremely useful when developing programs.
vi. Instructions are executed as soon as they are translated.
vii. Additionally, the program has to be translated every time it runs.
c). Interpreters have several advantages:

i. Instructions are executed as soon as they are translated.


ii. Since instructions are executed once translated, they are not stored for
later use. As a result, interpreters require less available memory.
iii. Interpreters do not produce an executable file that can be distributed. As
a result, the source code program has to be supplied, and this could be
modified without permission.
iv. Errors can be quickly spotted- once an error is found, the program stops
running and the user is notified at which part of the program the
interpretation has failed. This makes interpreters extremely useful when
developing programs.
d). Interpreters also have several disadvantages:

i. Interpreted programs run more slowly as the processor has to wait for
each instruction to be translated before it can be executed.
ii. There also needs to be temporary working space for the compiler to
perform the translation. Modern systems either have enough memory or
use virtual memory to hold all the data.
iii. Additionally, the program has to be translated every time it runs.
iv. Interpreters do not optimize code the translated code is executed as it is.
v. The interpreters do not produce an executable file that can be
distributed. As to be supplied, and this could be modified without
permission.

8. Convert the following numbers into binary [6]


a) 41
b) 67
c) 86
d) 100
e) 111
f) 127
……………………………………………………………………………………………
……………………………………………………………………………………………
……………………………………………………………………………………………
……………………………..
……………………………………………………………………………………………
……………………………………………………………………………………………
……………………………………………………………………………………………
……………………………..

9. Convert the following numbers into denary [5]


a 00110011
b 01111111
c 10011001
d 01110100
e 11111111
……………………………………………………………………………………………
……………………………………………………………………………………………
……………………………………………………………………………………………
……………………………..
……………………………………………………………………………………………
……………………………………………………………………………………………
……………………………………………………………………………………………
……………………………..

10. Convert the following binary numbers into hexadecimal [5]


a. 11000011
b. 11110111
c. 1001111111
d. 10011101110
e. 000111100001
11. Convert the following hexadecimal numbers into binary [10]
a. 6 C
b. 5 9
c. A A
d. A 0 0
e. 4 0 E
f. B A 6
g. 9 C C
h. 4 0 A A
i. DA47
j. 1AB

12. Convert the following hexadecimal numbers into denary. [10]


a. 6 B
b. 9 C
c. 4 A
d. F F
e. 1 F F
f. A 0 1
g. B B 4
h. C A 4
i. 12AE
j. AD89

13. Convert the following denary numbers into hexadecimal [8]


a. 9 8
b. 2 2 7
c. 4 9 0
d. 5 1 1
e. 8 2 6
f. 1 0 0 0
g. 2 6 3 4
h. 3 7 4 3
i. 4007

14. Given the following statement: (A OR B) AND (NOT A): [10]


a) Draw the logic gate

b) Complete the truth table

Inputs Output
A B A OR B NOT A X

You might also like