Introduction to Computer Science (I1100)
Lecture IV : Software
Lebanese University
Faculty of Sciences 1 - Department of Computer Science
Dr. Abed EL Safadi
Outline
– Software vs. Algorithm
– Software Categories
– Copyright status
– Flowcharts and Pseudo-code algorithm
2
Software vs. Algorithm
3
Software vs. Algorithm
Software is a set of computer instructions, that tell the
computer how to work. It consists of one or many files
(source code ).
Programming or coding means writing the source code of a
program.
Languages that programmers use to write source code are
called high-level programming languages
4
Software vs. Algorithm
5
What is an “algorithm” ?
Algorithm : a set of steps you
follow when solving a problem.
6
What is an “algorithm” ?
you might to have an algorithm for getting from home to office
Step 1: Bike to station
7
What is an “algorithm” ?
Step 1: Bike to station
Step 2: take train
8
What is an “algorithm” ?
Step 1: Bike to station
Step 2: take train
Step 3: walk to office
9
What is an “algorithm” ?
You might to have an algorithm for making a grilled cheese sandwich
Step 1: Buy bread
10
What is an “algorithm” ?
Step 1: Buy bread
Step 2: Apply Cheese
11
What is an “algorithm” ?
Step 1: Buy bread
Step 2: Apply Cheese
Step 3: Grill!!!
12
What is an “algorithm” ?
In computer Science, an algorithm is a set of steps for
a computer program to accomplish a task
Start with input data
Do Complex Calculations
Stop when we find answer
13
What is an “algorithm” ?
Flowcharts and pseudo-code are two ways to describe
algorithms.
A flowchart is a graphical description of an algorithm.
Pseudo-code is an intermediate language between
natural language like English and a programming
language like C, C++, Java…
14
Software vs. Algorithm
translated using a compiler
In order to solve a problem, we usually write an algorithm in
pseudo-code then the algorithm will be written in one of
the programming languages in order to be executed on a
computer. 15
Software vs. Algorithm
16
Software vs. Algorithm Example
Algorithm Program in C
Algorithm: SUM; # include <stdio.h>
int main()
Variables: integer x, y, z, s; { int x, y, z, s;
Begin
// displays a message on the screen
Write(“Enter three numbers:”); printf(“Enter three numbers:”);
// takes data from keyboard and stores them in
variables in memory
Read(x, y, z) scanf(“%d %d %d”, &x, &y, &z);
s = x + y + z; s = x + y + z;
// = represents an assignment operator that assigns a
value to s
Write(“The summation is ”, s); printf(“The result of the summation
is %d”, s);
end }
17
Outline
– Software vs. Algorithm
– Software Categories
– Copyright status
– Flowcharts and Pseudo-code algorithm
18
Software Categories
Software
Software
Systems Application
Software Software
19
Systems Software
The programs that are
dedicated to managing the
computer itself
Example : Operating System
20
Systems Software
File Management
system
Ms-DOS
The operating System manages the computer hardware
resources in addition to the application and data 21
Application Software
End-user programs
These software's enables
the user to complete task
such as create document,
database and publishing,
to do online research
(web browser), sending an
email (Gmail…), Game….
22
Outline
– Software vs. Algorithm
– Software Categories
– Copyright status
– Algorithm Flowcharts and Pseudo-code
23
Copyright status
– Software can be categorized according to its license
type
Available Code Unavailable Code
Source Source
Free 1. Open Source Free 2. Freeware Shareware
Pay 3. Commercial Open Source 4. closed source software
24
Copyright status
Open source software is software with its source code made available under a
certain license. The source code is open and can be modified as required..
Example: Linux operating system.
2. Freeware is software available for download and distribution without initial
payment. It is cost free and does not provide its source code. Examples: small
games, and Yahoo messenger. Shareware software is free during a test period
(often 1 month) and you have to purchase a license afterwards. Ex: WinZip.
3. Commercial open source software is software produced for sale or that
serves commercial purposes. Its source code is available and you have to pay a
fee to use it. Examples: Netbeans,
4. closed source software is non-free software for which the software’s
publisher retains intellectual property rights usually copyright of the source. So
the source code is not provided. Examples: Microsoft Windows 25
Outline
– Software vs. Algorithm
– Software Categories
– Copyright status
– Flowcharts and Pseudo-code Algorithm
26
Flowcharts and Pseudo-code Algorithm
• A flowchart is the graphical representation of an
algorithm. It details the sequence of operations
and decisions required to create output.
• Pseudo-code is a textual and an informal way to
describe an algorithm with a simple vocabulary.
27
Flowcharts and Pseudo-code Algorithm
Variable definition
A variable is a storage location (memory location).
145
a
Variable value
Variable name (data)
(identifier)
b Hello
Memory location
Variables in memory
28
Flowcharts and Pseudo-code Algorithm
Symbols Used in Flowchart
Different symbols are used for different states
in flowchart, for example: Input / Output and
decision making…
29
Flowcharts and Pseudo-code Algorithm
Symbols Used in Flowchart : Begin and End
Flowchart Symbol Pseudo - Code Description
Used to
Begin algorithm represent start
Begin My_Algo and end of
flowchart
……
End algorithm
End My_Algo
30
Flowcharts and Pseudo-code Algorithm
Symbols Used in Flowchart : Input and Output
Flowchart Symbol Pseudo - Code Description
Read Read is used to
take data from
user (Keyboard)
Write is used to
Write display some
data on the
Screen, Printer…
31
Flowcharts and Pseudo-code Algorithm
Symbols Used in Flowchart : Processing
Flowchart Symbol Pseudo - Code Description
Statement…. Used for
arithmetic
operations and
data
manipulations
32
Flowcharts and Pseudo-code Algorithm
Symbols Used in Flowchart : Decision (Test)
Flowchart Symbol Pseudo - Code Description
IF Test Then Used to
…… represent the
operation which
Else there are two
….. alternatives,
true and false
ENDIF
33
Flowcharts and Pseudo-code Algorithm
34
Flowcharts and Pseudo-code Algorithm
Begin
Example: Draw a Declare variables x1, x2 and sum
flowchart to add two
numbers entered by Read x1 and x2
user.
Sum=x1+x2
Write sum
End
35
Flowcharts and Pseudo-code Algorithm
Begin
Declare variables x1 and Result
Example: Draw a
flowchart to check Read x1
if a number entered
by the user is even Result=x1%2
or odd. False
Result ==0
true
Write (“is Write (“is
even number”) odd number”)
End
36
End of the chapter…
37