Nothing Special   »   [go: up one dir, main page]

IT 103 Presentation 1 Lesson1

Download as pptx, pdf, or txt
Download as pptx, pdf, or txt
You are on page 1of 31

Basic Programming

Concepts
Lesson 1 in IT 103
What is a program?
O Program –is a set of instructions
that the computer executes. A
program is a set of instructions
loaded in the CPU that the CPU
executes to achieve an outcome).
What is Programming?
O Programming-is instructing the
computer by means of a
programming language to perform
certain tasks for your desired output.
What is Programming Language?
O Programming language- is a
language which the computer
understands. It is just like any other
language with its own syntax and
constructs. The programmer uses it
to make the computer follow his/her
instructions.
Programming Languages
O are designed to communicate
instructions to a computer. It is used to
write or create computer programs that
control the behavior of a machine.
O Machine Language – It is the native tongue of the
computer that represents data and program instructions
as binary digits corresponding to the on and off electrical
states in the computer or binary string of 0’s and 1’s that
specifies an operation.
O Low Level Language – provides little or no abstraction
between the language and machine language. A low level
language does not need a compiler or interpreter to run;
the processor for which the language was written is able
to run the code without using either of these.
O High Level Language - enables the common
programmer to write Compiler - translates
a computer programs
programs using
written in
instructions that resembles a particular
everyday language
language. It is into
also
a machine
called compiler language, sincelanguage.
these languages require a
special program called a compiler.
High Level Language
OSource program – the original
program that is written in a high-level
language.
OObject program – the original
programs translation in machine
language.
O Assembly Language – this is a type of low-level
programming language. It can be an alternative to
machine language but it uses mnemonic codes or
abbreviations that are easy to remember. An
assembly language might be used instead of high-
level language for any of these three major reasons:
speed, control, and preference. Program written in
assembly language run faster than those generated
by a compiler. The programmer must use an
assembler to translate the assembly language into
machine code
Examples of Programming Languages

O Ada O C#
O BASIC O Java
O FORTRAN O JavaScript
O COBOL O Python
O Pascal O Ruby
O C and C++ O Visual
Basic/VB.Net
Core Hardware Components to
Run a Program
The two major components to execute a
program are:

1) CPU (Central Processing Unit) runs a set of


instructions.2) Memory (RAM Random Access
Memory) works as a temporary storage to help the
CPU achieve the desired output/outcome.
Tools for Creating a Program

ALGORITHM
To write a logical step-by-step method to solve the
problem is called algorithm, in other words, an
algorithm is a procedure for solving problems. In order
to solve a mathematical or computer problem, this is
the first step of the procedure. An algorithm includes
calculations, reasoning and data processing.
Algorithms can be presented by natural languages,
pseudo code and flowcharts, etc.
Tools for Creating a Program
FLOWCHART
Flowchart is the graphical or pictorial
representation of an algorithm with the help of
different symbols, shapes and arrows in order to
demonstrate a process or a program. With
algorithms, we can easily understand a program.
The main purpose of a flowchart is to analyze
different processes. Several standard graphics are
applied in a flowchart.
TYPES OF FLOWCHART

O Document Flowchart. These have the


purpose of showing existing controls over
document-flow through the components of a
system. The chart is read left to right and
documents the flow of documents through the
various business units.
TYPES OF FLOWCHART

O Data Flowchart. These show “the controls


governing data flows in a system. These are
used primarily to show the channels that the
data is transmitted through the system rather
than how control flows.”
TYPES OF FLOWCHART

O System Flowchart. These show the flow of


data to and through the major components of a
system such as data entry , programs, storage
media, processor and communication network.
TYPES OF FLOWCHART

O Work Flow Flowchart. To document


workflows, often involving tasks, documents
and information in offices. A workflow
diagram depicts a series of action that defines
a job 0r how work should be done.
TYPES OF FLOWCHART

O Program Flowchart. These show the


controls placed internally to a program within
a system.
Basic Flowcharting Symbols

O Start/End Symbol

O The terminator symbol marks the starting or


ending point of the system. It usually contains
the word "Start" or "End."
Basic Flowcharting Symbols

O Action or Process Symbol

O A box can represent a single step (”SUM=A+B),


or and entire sub-process (”x=x+1") within a
larger process.
Basic Flowcharting Symbols

O Decision Symbol

O A decision or branching point. Lines


representing different decisions emerge from
different points of the diamond.
Basic Flowcharting Symbols

O Input/Output Symbol

O Represents material or information entering or


leaving the system, such as customer order
(input) or a product (output)..
Basic Flowcharting Symbols

O Preparation Symbol

O Also called “Initialization Symbol”. Represents


a set-up to another step in the process.
Basic Flowcharting Symbols

O Connector Symbol

O Indicates that the flow continues where a


matching symbol (containing the same letter)
has been placed.
Basic Flowcharting Symbols

O Off Page

O Indicates that the process continues off page.


Basic Flowcharting Symbols

O Flowlines

O Indicates directions of flow.


How to Use Flowcharts to Represent Algorithms

O Algorithms are mainly used for mathematical


and computer programs, whilst flowcharts can
be used to describe all sorts of processes:
business, educational, personal and of course
algorithms. So flowcharts are often used as a
program planning tool to visually organize the
step-by-step process of a program.
Here are some examples:

Example 1: Create a program that will print


numbers 1 to 20:
Algorithm:
Step 1: Initialize X as 0,
Step 2: Increment X by 1,
Step 3: Print X,
Step 4: If X is less than 20 then go back to step
2.
Flowchart No.1
Example 2: Determine whether a
student passed or not based on his/her
average scores. Grades lower than 60
means FAIL otherwise PASS
 
Algorithm:
Step 1: Input scores of 4 subjects M1, M2, M3
and M4,
Step 2: Calculate the average grade with formula
"Grade=(M1+M2+M3+M4)/4"
Step 3: If the average grade is less than 60, print
"FAIL", else print "PASS".
Flowchart No.2
THANK YOU!!!!

You might also like