You are on page 1of 2

Form iv - 2013

Computer Studies Programming Language

Topic: Programming Language 1. Programming language and concepts


Program: It is a set of instructions that tell the computer what to do. Programs are written by programmers using programming languages Two groups of programming languages: 1) High Level Languages: allow users to write instructions using English-like syntaxes. (E.g COBOL, PASCAL, C) Advantage of high-level language: - It is computer independent. That is, programs written for one computer can run on another computer. - Easy to debug and test programs. - It is easy to understand as it uses English-like syntax Disadvantage of high-level language: - Programs written in high level languages run slowly as they need translation - They occupy more space than low level languages.

2) Low Level Languages: a programming language that is near to the understanding power of computers. (E.g Binary form, assembly language) Advantages of Machine codes: - It is faster to execute. - It occupies less memory space. Disadvantages of machine codes: - It is machine dependent. It works on only one type of computer. - It is difficult to decode and modify. ASSEMBLY LANGUAGE: It uses mnemonics instead of the binary form for instructions. e.g instead of using binary code 10110001 for multiply, assembly language uses MUL. Assembler is used to translate assembly language instructions into machine code. Reasons why assembly language are still used: They are closely tied with the particular model of the computer, therefore, they are faster to respond compare to instructions in HLL Occupies less memory space

Other TWO TYPES OF TRANSLATORS:


Interpreters Convert high-level languages into machine code Convert one instruction at a time, executing it immediately To run programs that use an interpreter, requires the user to have an interpreter themselves Page 1 of 2 MK

Form iv - 2013 Computer Studies Programming Language The final program runs more slowly than a compiled program Compilers Convert high-level languages into machine code Convert the whole program in one go The program cannot be run until it is fully compiled Once a program is compiled, the user does not need a compiler to run it (the program is 'stand -alone' The resulting programs run very quickly compared to interpreted programs Writing program Approaches: Top down design (modular programming) It is the process of breaking the overall systems into small and manageable tasks. Advantages: 1. Easier to identify and debug errors in smaller regions 2. Breaks systems into small and manageable tasks 3. Modules can be reused. 4. Different people can work on different part of the program. 3. System flowchart The system flowchart is a graphical representation of an overall system. It shows the tasks that are performed on the data. 4. Program Flowchart Shows the sequence in which instructions are executed when the system is run using flow lines and symbols. Exercises: 1 What is the name given to a set of instructions the computer can understand? 2 Programs are written in computer languages. What is the computers own language called? 3 What is an example of a low-level language? 4 What is a high level language? 5 Give three features that the various high level languages have in common. 6 Why are translator programs needed? 7There are three types of translator programs. What are the names of these types of translators? 8 a) Describe in general terms how a compiler works b) What is the object code? c) What is the source code? 9 a) Describe in general terms how an assembler works. b) Why would a company want a program written in assembly language? 10 a) Describe in general terms how an interpreter works. b) What advantages are there to using an interpreter? 11Give three reasons why a programmer would prefer to use a high level language. 12Give two reasons why a low-level language may be used. 13What is meant by software portability? 14Name a language, which is well known, for its portability. 15 A programmer has written a program that will run fast, but will be easy to edit. Which type of translator software should she choose? Give reasons for your answer.

Page 2 of 2

MK

You might also like