Gey 201
Gey 201
Computer Programming I
Course Lecturer:
Mr. I. H. Ibrahim
([email protected])
2
Course Grading
• Coursework: 30%
Practical: 30%
Starting Date: Due Date:
• Exam: 70%
Mode: Objective and subjective
Date: Will be communicated later
3
Introduction to Computer
• A computer is an amazingly fast but are not
capable of independent thought or creativity.
• A computer can do anything you tell it (within
reason), but it does exactly what it’s told nothing
more and nothing less.
• Computers don’t understand any reasonable
human language they don’t speak English either.
• Computers understand a language variously
known as computer language or machine
language.
4
• It is possible but extremely difficult for humans
to speak machine language.
• Therefore, computers and humans have agreed
to sort of meet in the middle, using intermediate
languages such as Python, C++, java, Fortran,
Pascal and so on.
• Humans can speak Python (sort of), and C++ is
converted into machine language for the
computer to understand.
5
What is Computer ?
A computer is an electronic machine which
receive input, process it, store it and produce
output according to given instruction.
What is Computer Science?
Computer Science is a discipline that studies the
theory, design and applications of computational
systems.
Computational Systems
• Hardware aspect
• Software aspect
• Application aspect
6
7
grammar
8
(1)
9
The shortcomings of the machine language are that:
Coding in machine language was a very tedious and
boring job.
Machine language was not user-friendly.
Debugging any set of codes is a very difficult task. 10
The disadvantages of assembly language are that:
It is specific to particular machines.
It requires a translator called an assembler.
11
12
13
14
15
Some Advantages of High-Level Language:
It is more user friendly, that is, easy to learn and
write.
It is very portable, that is, it can be used on almost
any computer.
It saves much time and effort when used
compared to any other programming level
language.
Codes written in this language can easily be
debugged.
16
Features of Programming Languages
There are some conventional features which a programming
language must possess, these features are:
It must have syntactic rules for forming statements.
It must have a vocabulary that consists of letters of the
alphabet.
It must have a language structure, which consists of
keywords, expressions and statements.
It may require a translator before it can be understood
by a computer.
Programming languages are written and processed by
the computer for the purpose of communicating data
between the human being and the computer.
17
18
19
20
21
22
23
24
Program Design Process
29
Types of Error
You will encounter three kinds of errors as you
develop program:
• Syntax error: Occur when the code violates
programming language’s syntax rules.
• Compile - time error: This is the error identified
during compilation process.
• Runtime error: It occur during execution of the
code.
• Logical error: Occur when the code executes
without errors but produces incorrect results.
30