Fundamentals of Programming
Fundamentals of Programming
Fundamentals of Programming
Instructor: Fred. Yeboah Email:[email protected]
Course Objectives
Understand basics of programming Analyse problem Design solution algorithms using flow chart and pseudo-code Prove correctness of developed algorithms
What is programming?
is the act of writing instructions using a particular programming technology or language for a computing device to execute them
Note:
for any special computing device to provide a functionality to its user implies a program has been written by someone for that device. Think of the following computing devices:
Computing devices do what we tell them to do and NOT what we want them to do! Computing devices do not have the capacity to think and make judgment on their own Computing devices have different capacity in terms of volume of instructions to execute and space to store information or data
A programming language gives the programmer the ability to express him / her intention by writing them as instructions for the computing device.
C programming (C) - French Java programming - English Visual Basic (V.B) - German
Programming languages allow programmers to code software. The three major families of languages are:
Machine Languages
Comprised of 1s and 0s The native language of a computer Difficult to program one misplaced 1 or 0 will cause the program to fail. Example of code:
1110100010101 10111010110100 111010101110 10100011110111
Assembly Languages
Assembly languages are a step towards easier programming. Assembly languages comprised of a set of elemental commands which are tied to a specific processor. Assembly language code needs to be translated to machine language before the computer processes it. Example:
ADD 1001010, 1011010
@2011 AITI-KACE All Rights Reserved - Fundamentals of Programming
High_level Languages
High-level languages represent a giant leap towards easier programming. The syntax of HL languages is similar to English. Historically, we divide HL languages into two groups:
10
Compiling / Interpretation
all HL programs need to be translated to machine code so that a computer can process the program.
Some programs are translated using a compiler. During compilation all source code are translated all at once.
Some programs are translated using an interpreter. Such programs are translated line-by-line instead of all at once (like compiled programs).
11
Written languages
Programming languages
12
13
Communication cycle
One complete unit of communication includes:
14
15
While communication between individuals use the same language, computing devices and individuals do not. The following areas are where they differ
Semantics Syntax
16
Human language:
Computer language:
Refers to the meaning of what is being said. Words often pick up multiple meanings. Phrases sometimes have idiomatic meanings: let sleeping dogs lie
Input, Output, Print Each command has a very specific meaning. Computers associate one meaning with one computer command.
17
Human language:
Computer language:
18
Human language:
Computer language:
How many ways can you say no? Do they have the same meaning?
19