Sie sind auf Seite 1von 3

1516-90919

Level L Computer Science AMS

Page 1 of 3

Sample Questions Exam

1. What is a compiler? What does it do?

2. Is a compiler hardware or software?

3. Differentiate between source code/program and object code/program?

4. List some applications written in a high level language.

5. Are assembly language programs directly understood by the computer?


Note: The assembly language is also a low-level Language
6. Compare the difficulty of writing and understanding assembly language programs with machine
langue and high-level language programs

7. What are the properties of a low-level language?


One low-level instruction translates to ..
It allows efficient use of hardware.
8. Why some applications are written in a low level (assembly) language?

9.

Is an assembler hardware or software? What does it do?

10.

What are the characteristics of machine language instructions?

Machine language instructions are made up of sequences of 1s and 0s. True/False


Machine language programs.(are/are not) portable.

11.
Do machine language programs require translation?
Are machine language programs usually difficult to write and understand?

12. For a computer to execute a program, in what form must the program be?

13. What are the advantages of high-level languages over low-level languages?

1516-90919

Level L Computer Science AMS

Page 2 of 3

14. Which of the following is not a feature of a high-level language?

Easy to write subprograms because standard routines are available


Save memory location as it doesnt generate an object code
Easy to run on any computer having the right compiler

15. Why are there several high-level programming languages?

16. What are the features of an interpreter?

17. Why is using an interpreter is better than using a compiler when the memory is limited?

18. Which of the following is/are false about a programming language?

All the programming language are portable


It is used to write computer programs
Selecting a programming language depends on the type of problem
Writing program instructions must follow the rules of the programming language being used
All programming instructions must be written in binary codes
A high level language allows us to easily control access to memory and hardware
An assembly language is a low level language

19. Which of the following is not a feature of a compiler?


A. It translates a whole program in one go
B. The code needs to be re-translated each time a change is made
C. It only finds errors as each instruction is executed
D. It translates source code into object code
E. It produces an error list at the end of translation

20. List 5 high-level languages


21. Differentiate between syntax error and logic error. Give examples.

22. What does the control of flow instructions do? What do they include?

23. What do data transfer instructions include? What is their role?

1516-90919

Level L Computer Science AMS

Page 3 of 3

24. Which of the following is false about an algorithm in pseudocode and a computer programs?
A. Each pseudocode/ computer programs provides a solution to some problem
B. A computer can run algorithms in pseudocode
C. Programmers convert algorithms in pseudocode into computer programs
D. Algorithms in pseudocode are human readable
E. Computer programs are machine readable

Note:
A language is portable or not portable and not an assembler or compiler or interpreter
1 high level instruction translates to many machine code instructions so it is NOT machine specific
1 low level instruction translates to one machine code instruction so it is machine specific
High level programs are portable and low level (machine code & assembly) are Not

25. What is the purpose of the following code?


x=0
Integer values [1:30]
FOR k 1 to 30
INPUT values [k]
IF values [k] = 75 THEN x x +1
Next k
OUTPUT x

26. Consider the following code:


INPUT score
IF (score >= 95)
grade = 1
ELSE IF (score >= 75)
grade = 2
ELSE IF (score >= 65)
grade = 3
ELSE IF (score > 45)
grade = 4
ELSE grade = 5
ENDIF
OUTPUT garde
What is the output of the code if the value of score = 20?
What is the output of the code if the value of score = 65?
What is the output of the code if the value of score = 80?

Das könnte Ihnen auch gefallen