0% found this document useful (0 votes)
6 views12 pages

Programming Basics

Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
6 views12 pages

Programming Basics

Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 12

Topic1- Programming

Basics

Fundamentals of programming CSC401


Software/ProgramDevelopment
lifecycle

Watch the video:


[Link]
v=4xCldpbDZ10
Algorithms:
• Set of well-defined logical steps that must be taken to perform a task or solve a problem.

• Algorithm is needed to create a program code to be executed by the computer.

• Computer executes instructions in order when running a program.

➢Watch : [Link]
Decompose a problem into smaller
problems .

To solve a Create a correct algorithm to solve


them.
problem:

Solutions for the small problems


can then be combined to solve the
bigger problem.
Algorithm

Pseudocode Flowchart

series of statements that can be diagram that demonstrates the steps


translated into a computer program of a computer program execution
How does a computer program work?
• Computers are able to perform very complex tasks, but
this ability relies on executing programs instructions.
• A program makes a computer usable. Without a
program, a computer, even the most powerful one, is
nothing more than an object.
Natural languages vs. programming languages:
• A language is a means (and a tool) for expressing and recording
thoughts. There are many Natural languages all around us.
(Example: Arabic, English,French...)
• Computers have their own language, too,
called machine language, which is very rudimentary(primitive or
basic).
• The machine language contains determined words called
commands.
• A complete set of known commands is called an instruction list,
sometimes abbreviated to IL.
What makes a language?
Each language (machine or natural, it doesn't matter) consists of the following
elements:
• Alphabet: a set of symbols used to build words of a certain language
(a,B,‫ش‬،‫…ل‬.)
• Aexis: a set of words the language offers its users.
• Syntax: a set of rules (formal or informal, written or felt intuitively) used to
determine if a certain string of words forms a valid sentence (e.g., "I am a
python" is a syntactically correct phrase, while "I a python am" isn’t)
• Semantics: a set of rules determining if a certain phrase makes sense (e.g., "I
ate a doughnut" makes sense, but "A doughnut ate me" doesn't)
Compilation vs. interpretation
There are two different ways of transforming a program from a high-level
programming language into machine language:

1- Compilation.
2- Interpretation.
Compilation vs. interpretation
1) COMPILATION - the source program is translated once by getting a file (e.g. an .exe file
if the code is intended to be run under MS Windows) containing the machine code,
you can distribute the file worldwide. The program that performs this translation is
called a compiler or translator;

2) INTERPRETATION - you can translate the source program each time it has to be run,
the program performing this kind of transformation is called an interpreter, as it
interprets the code every time it is intended to be executed; it also means that you
cannot just distribute the source code as-is, because the end-user also needs the
interpreter to execute it.

You might also like