This document provides an introduction to computer science and programming. It discusses how programming involves designing algorithms to solve problems by writing instructions in programming languages. It also describes different types of programming languages like machine languages, assembly languages, and high-level languages. Interpreters and compilers are introduced as tools used to translate high-level languages into machine-readable code. The key differences between interpreters and compilers are explained. Examples of popular programming languages are also listed.
Behavioral Disorder: Schizophrenia & it's Case Study.pdf
Introduction to Computer Science Lecture on Programming, Languages, Compilers and Interpreters
1. INTRODUCTION TOCOMPUTER SCIENCE
CSC 1302
LECTURE 4
Department of Maths and Computer-
Science
Faculty of Natural and Applied Science
BY
UMAR DANJUMA MAIWADA
2. PROGRAMMING
Programming is all about designing and coding
algorithm for solving problems.
Computers are not very intelligent, the instruction they
receive must be extraordinary special.
We write computer instructions in programming
languages, which are more constrained and exact than
human languages are.
It must follow a series of algorithm.
2
3. MACHINE LANGUAGES
Instructions written in these language
correspond directly to the hardware
operations of a particular machine.
It deals directly with the computers physical
component.
They are represented in binary.
3
4. ASSEMBLY LANGUAGE
It allows the use of words rather than binary
number.
The words corresponds to operations performed by
the computers physical components.
4
5. HIGH LEVEL LANGUAGE
It is use to solve complex problems which is quick
and reliable and it relates to the way human thinks.
It provides natural frame work through which problem
is solved.
It include abstraction
5
6. INTERPRETERS AND COMPILERS
The interpretation approach relies on a program
known as an interpreter to translate and execute
the statement in high level language program.
Interpreter reads the statement one at a time,
translating and executing each statement before
processing the next one.
Compilation approach relies on a program known
as a compiler to translate the entire high level
language program into its equivalent machine
language instructions.
6
7. THE DIFFERENCE BETWEEN COMPILER AND
INTERPRETER
Compilation is more faster than translation because
compilation is done once and for all, the interpreter
and the source code are needed every time the
program runs
Compilation is a one shot translation, once a
program is compiled, it may be run over and over
again without further need for the compiler or the
source code.
7
8. EXAMPLE OF PROGRAMMING LANGUAGES
JAVA
Python
C++
C
Pascal
COBOL (common business oriented language)
FORTRAN (formula translator)
9. Good programming practices
•Your code may be used by somebody else
•The code may be long
•Should be easy to understand for you and for others
•Saves lot of errors and makes debugging easier
•Speeds up program development
9