SlideShare a Scribd company logo
1 of 98
FUNDAMENTAL OF COMPUTER
PROGRAMMING
L.NIVETHA AP/CSE,KNCET
Computer System – CPU –
Memory Unit – Data
Representation – Number System
and Conversion – Programming
Fundamentals – Program
Development Life Cycle –
Algorithm – Control Structures –
Flow Chart – Pseudo code –
Programming Paradigms –
Problem Formulation and Problem
Solving.
L.NIVETHA AP/CSE,KNCET
Computer is an electronic device that
accept data and process those data’s to
perform mathematical and logical operation
also provide desired output .
The computer system consist of four parts:
1. Hardware,
2. Software,
3. Data,
4. Users.
L.NIVETHA AP/CSE,KNCET
Hardware Consist of mechanical parts that
make up the computer as a machine.
The hardware consist of physical devices
of the computer, computer system having
input , output, storage and processing of
data.
Example: Keyboard, Monitor, RAM, Hard
disk, Printer, Processor……etc
L.NIVETHA AP/CSE,KNCET
Software is a set of instruction that is used to
perform the user task’s.
Program also set of instruction that written by
using some programming languages that is
understood by the computer also solve the
specified task.
The hardware components of the system
cannot perform any task without the use of
software.
There are two types of software:
1. System Software - Windows , Linux … etc
2. Application Software - Ms Office, C, C++
….. etc
L.NIVETHA AP/CSE,KNCET
The data is provided as a input to the
computer system , Which is processed and
generate meaningful information,
System that accept the data as Alphabets
A…. Z, and Numbers 0…..9. with the use of
Keyboard.
L.NIVETHA AP/CSE,KNCET
Users are peoples who write the computer
program or interact with the computer
Those are called as Programmers, Data
Entry operators, System analyst and
Computer Hardware Engineer comes under
the users of the computer system.
L.NIVETHA AP/CSE,KNCET
The Computer system having three major
components.
1. Input/Output(I/O)unit
2. Central Processing Unit
3.Memory Unit
L.NIVETHA AP/CSE,KNCET
Input/ Output Unit
The user interact with the computer through
the I/O unit.
The input unit accepts the data from the user
through input devices like keyboard, mouse,
scanner … etc
The output unit provides the processed data
through monitor, printer … etc
Central processing unit:
Central processing unit or processor called as
a brain of the computer, it consist of control unit,
ALU, and set of Registers.
Memory:
the memory unit consist of cache memory
and primary memory these memory are used to
store the data when the processing of
instruction.
L.NIVETHA AP/CSE,KNCET
Central Processing Unit or the processor
called as a brain of the computer,
it consist of control unit, Arithmetic Logic
Unit, and set of Registers which are
temporary storage areas for holding data and
instruction.
ALU perform arithmetic and logical
Operation, CU Control unit controls and
Coordinate the activity of other units.
L.NIVETHA AP/CSE,KNCET
CONTROL UNIT
ARITHMETIC AND
LOGIC UNIT
REGISTERS
CENTRAL PROCESSING UNIT
L.NIVETHA AP/CSE,KNCET
CPU Executes the stored program
instructions, those instruction and data
stored in memory before execution.
It interprets the instruction and perform
the arithmetic and logic operation and send
the processed data or results into memory.
CPU also act as a administrator and
responsible for supervising operations of
other parts of the computer.
L.NIVETHA AP/CSE,KNCET
ALU consist of two units – arithmetic unit and
logic unit.
Arithmetic unit performs arithmetic
operations on the given data like addition,
subtraction, Multiplication, Division…
The logic unit of ALU is responsible for
performing logical operation.
It will perform the logical operation based on
the user Expression. Testing also performed by
using Relational Operator.
The ALU perform arithmetic logic operation
and store the processed results into memory.
L.NIVETHA AP/CSE,KNCET
Registers are high speed storage areas
with in the CPU. But having less storage
capacity.
Registers not having any address location
but register instruction directly accessed by
the CPU.
It store data instructions and addresses
and intermediate results of processing.
Before processing of any logics we need
data and program instruction within the
register.
CPU having different register each register
serving a specific purposes.
L.NIVETHA AP/CSE,KNCET
PC IR
MAR ACC
MBR DR
L.NIVETHA AP/CSE,KNCET
 ACC – Accumulator it stores the result of
arithmetic and logic operation.
 IC – Instruction Register it stores current
instruction most recently used.
 PC – Program Counter contains the address
of next instruction to be processed.
 MAR – Memory address Register contains
address of next location in the memory to be
accessed.
 MBR – Memory Buffer Register Temporarily
stores data from memory or data store to the
memory.
 DR - Data Register it stores variable and any
other data.
L.NIVETHA AP/CSE,KNCET
 The control unit does not do any operation
but it organize the processing of data and
instruction.
 It act as a Supervisor and controls the activity
of other units in the computer.
 Control Unit directs the computer to carryout
stored program instruction by
communicating with ALU and registers.
 CU also holds the CPU’s instruction set.
L.NIVETHA AP/CSE,KNCET
Memory unit used to store the instruction,
data, images and video….etc
There are following memory available in
the system
1. Cache Memory - Storage Buffer
2. Primary Memory(volatile memory) - RAM
and ROM
3. Secondary Memory(Non Volatile Memory) -
Hard disk, Memory Cards…etc
L.NIVETHA AP/CSE,KNCET
Cache memory is a very high speed
memory placed in between RAM and CPU. The
cache memory increases the speed of
processing.
Cache memory is a storage buffer that
stores the data and used by the CPU,
At first the CPU will check any data in
cache memory if not found then ask data
from RAM.
Cache memory is build-in into processor,
located between CPU and RAM memory.
L.NIVETHA AP/CSE,KNCET
The CPU has a build-in Level1(L1) Cache
and Level2(L2) Cache. In addition of L1 and
L2 Cache, some CPU,s have separate cache
chip on the motherboard called (L3) cache.
These cache stores the recently used
instruction.
Cache Memory is very expensive, so it is
small in size, computer have cache memory
size 256KB to 2MB
L.NIVETHA AP/CSE,KNCET
Primary Memory:
Primary memory is called as main
memory, It is used to store data and
information's during the processing of data.
Primary memory is a semiconductor
memory. Primary memory is two kinds RAM
and ROM.
RAM Random Access Memory is a volatile
memory, the information stored in RAM gets
erased when the computer is turned off.
L.NIVETHA AP/CSE,KNCET
The ROM is a non volatile memory, but it
is a read only memory. the storage in ROM is
permanent in nature, the instruction are
written by the manufacturer itself.
The input data entered through input
devices are stored in RAM, also processed
output data also stored in RAM.
RAM having limited storage capacity, due
to its high cost.
Data flow:
Hard disk - RAM - Cache - CPU.
L.NIVETHA AP/CSE,KNCET
Secondary Memory:
The secondary memory stores data and
instruction permanently. The information
stored in secondary memory for long time
and is generally permanent in nature unless
erased by the user. It is a non volatile
memory.
It provide backup storage for data and
instruction.
the secondary memory has a high storage
capacity than the primary memory.
L.NIVETHA AP/CSE,KNCET
secondary memory is also cheaper than
the main memory.
the stored data in the secondary devise
currently not used by CPU, but it may be
required in later use.
It take longer time to access the data and
instruction.
L.NIVETHA AP/CSE,KNCET
The data stored in a computer may be of
different kinds
1. Numerical data – (1,2,3……9)
2. Alphabetic data – (a,b………z)
3. Alphanumeric data – it is a combination of
(A,B…….Z ) and Numbers (1,2,3……….9).
All kind of data is represented in terms of
0’s and 1’s in the computer. Each symbol is
represented as unique notation.
L.NIVETHA AP/CSE,KNCET
The following number system are used in the
computer:
1. Decimal number system
2. Octal number system
3. Binary number system
4. Hexadecimal number system.
L.NIVETHA AP/CSE,KNCET
Decimal number system:
It consist of 10 digits - 0,1,2,3…..9
All the numbers in decimal are represented
within 0…9 for example : 3425
The base value of decimal is 10
Octal Number System:
The octal number system consist of eight
digit - 0……7
All the number in octal represented in eight
digit Example: 0,1……7
The base value of octal is 8
L.NIVETHA AP/CSE,KNCET
Binary Number System:
The Binary number system consist of two
digit – 0, 1
All the binary number are represented in this
two digits Example: 010010
The base value of binary is 2
Hexadecimal number system:
The hexadecimal number system consist of
sixteen digits - 0….9 A,B,C,D,E,F
All the hexadecimal number are represented
using this sixteen digit Example: 9A67E.
The base value of hexadecimal is 16
L.NIVETHA AP/CSE,KNCET
To convert one number system to another
number system is called number conversion.
There are 12 conversion is possible there
are:
1. Decimal to binary, Octal, Hexadecimal
2. binary, Octal, Hexadecimal to Decimal
3. Others to Others (without combination of
decimal)
L.NIVETHA AP/CSE,KNCET
L.NIVETHA AP/CSE,KNCET
L.NIVETHA AP/CSE,KNCET
L.NIVETHA AP/CSE,KNCET
L.NIVETHA AP/CSE,KNCET
L.NIVETHA AP/CSE,KNCET
L.NIVETHA AP/CSE,KNCET
L.NIVETHA AP/CSE,KNCET
L.NIVETHA AP/CSE,KNCET
L.NIVETHA AP/CSE,KNCET
L.NIVETHA AP/CSE,KNCET
L.NIVETHA AP/CSE,KNCET
L.NIVETHA AP/CSE,KNCET
L.NIVETHA AP/CSE,KNCET
L.NIVETHA AP/CSE,KNCET
Computer is an electronic device that
accepts data, processes it , and generate
relevant output. It can perform both simple
and complex task.
But the computer cannot perform any
task it’s own.
computer is need some instruction how to
process the specified task to be performed.
The set of instruction that instruct the
computer about way to task to be performed
is called program.
L.NIVETHA AP/CSE,KNCET
A program is required for all kind of tasks
like simple task to perform arithmetic
calculation and complex task like gaming.
Through this program to perform all kind
of task.
L.NIVETHA AP/CSE,KNCET
PROGRAM DEVELOPMENT LIFE CYCLE
Presented by,
L.Nivetha,AP/CSE,
KNCET
KONGUNADU COLLEGE OF ENGINEERING AND TECHNOLOGY
(AUTONOMOUS)
NAMAKKAL - TRICHY MAIN ROAD, THOTTIAM, TRICHY-621 215
L.NIVETHA AP/CSE,KNCET
A program is needed to instruct the
computer about the way a task is to be
performed. The instruction in a program have
three essential part.
1. Instructions to accept the input data
that needs to be processed.
2. Instruction that act as a input data and
process it.
3. instruction to provide the output to
user.
L.NIVETHA AP/CSE,KNCET
The instruction in a program are defined
in a specific sequence. A program is write by
a programmer based on the program
Development Life Cycle.
Program
Analysis
Program
Development
Program
Design
Program
development
life cycle
Program
Documentation
and
Maintenance
L.NIVETHA AP/CSE,KNCET
The programmer first understand the
problem to be solved.
The programmer find out the different
ways the problem can be solved, and decide
the best solving solution which will be
followed to solve the problem
L.NIVETHA AP/CSE,KNCET
The selected solution is represented in form,
then it will be coded. This require three types:
1. An algorithm is written, Which is in
simple English.
2. A flowchart is drawn, which is the
diagrammatic representation of a solution. It
is easy to understand.
3. A Pseudo code is written, Pseudo code
uses the structured program construct .
L.NIVETHA AP/CSE,KNCET
Definition:
Algorithm is an ordered sequence of finite,
well defined, unambiguous instruction for
completing task.
Algorithm is defined as a step by step procedure
for solving any problem . It is one of the basic tools
used to develop the problem solving .
It is also a precise rule to specifying how to solve a
problem.
L.NIVETHA AP/CSE,KNCET
Example:
ALGORITHM FOR AREA OF CIRCLE
STEP-1: Start the program
STEP-2: Read the value of radius r
STEP-3: Calculate Area=3.14*r*r
STEP-4: Print the area of circle
STEP-5: Stop the program
L.NIVETHA AP/CSE,KNCET
Example:
ALGORITHM FOR AREA OF CIRCLE
STEP-1: Start the program
STEP-2: Read the value of radius r
STEP-3: Calculate Area=3.14*r*r
STEP-4: Print the area of circle
STEP-5: Stop the program
L.NIVETHA AP/CSE,KNCET
 Flowchart is a pictorial representation or
diagrammatic representation of an algorithm.
 A flowchart uses different shaped symbols for
representing different instruction and this
information written into small boxes using
clear statement.
 Here lines and arrow mark represent flow of
operation.
 The purpose of drawing a flowchart is to
represent the logic of the program to clear
manner in visual form.
L.NIVETHA AP/CSE,KNCET
 Flow lines
 Terminal symbols
 Input/output symbols
 Process symbols
 Decision symbols
 Connectors
L.NIVETHA AP/CSE,KNCET
Example : Addition of two numbers
start
C=a+b
Read a
b
Write
c
stop
L.NIVETHA AP/CSE,KNCET
 Pseudo code is also a formal design tool.
 Pseudo code consist of short , readable and
written in normal English used to explain an
algorithm.
 Pseudo code does not include details like
variable declaration , subroutines …
 It is a short hand way of describing the
computer program
 It is easier for programmer or non
programmer to understand the general
working of the computer program .
 Pseudo code cannot be compiled or executed
L.NIVETHA AP/CSE,KNCET
Rules for writing Pseudocode:
1. Pseudo code written in structured English
2. Write one statement per line
3. Capitalize Keywords – READ,WRITE,IF,
ENDIF, WHILE , UNTIL.
4. Indent to show hierarchy
5. End with multiline structure
6. Keep statements Language independent
Input: READ , GET , INPUT
Output: OUTPUT , PRINT , DISPLAY.
Calculation: COMPUTE , CALCULATE , ADD
…etc
Increment : INCREMENT.
L.NIVETHA AP/CSE,KNCET
3.PROGRAM DEVELOPMENT
The computer programming languages are different
kinds, low level and high level languages like C, C++, Java,
,,,etc
Based on the programming language first to write a
pseudo code.
Using this pseudo code to write the program based on
the language instruction.
These program compiled for any syntax error. Syntax
errors arise due to incorrect use of the programming
language.
The successfully compiled program to be executed
When the time of execution to give input data that will
be processed and produce the corresponding output.
L.NIVETHA AP/CSE,KNCET
4.Testing the program:
Testing is the process of verify the
expected result is came or not.
5.Program Documentation and Maintenance.
The program is properly documented, so
that later on any one can use it and
understand it’s working.
Any changes made in the program, after
installation due to add some features in the
application is called maintenance.
L.NIVETHA AP/CSE,KNCET
• An Algorithm contains step by step effective
information, It is not a computer program ,It
is one of the basic tool in problem solving.
Characteristics:
 Algorithm has a finite number of inputs.
 Every instruction should be precise and
unambiguous.
 It looks like a normal English.
 Effectiveness of each step is very important.
 The desired output must obtained only after
the algorithm terminates.
 The algorithm should written in sequence.
L.NIVETHA AP/CSE,KNCET
Different algorithm may perform the
same task with different set of instruction.
Some algorithm is better than the other in
solving problem.
The following factors that determine the
Quality of algorithm are :
1.Time
2. Memory
3. Accuracy
4. Sequence
5. Generability
L.NIVETHA AP/CSE,KNCET
Control flow is defined as each and every
program having it’s own logic’s , Based on
this logic the control flow vary from one
program to another .
The basic control flow needed for writing
good and efficient algorithm there are.
1. Sequence Control Flow
2. Selection Control Flow
3. Iteration (Looping ) Control Flow
L.NIVETHA AP/CSE,KNCET
Here the instructions are executed in a
linear order one after the other,
The instruction in sequence control flow
are executed exactly once
Example:
Step1: start the program
Step2: Read the element num1 , num2
Step3: Calculate sum=num1 + num2
Step4: Print the sum
Step5: stop the program
L.NIVETHA AP/CSE,KNCET
Here the step to be executed based on the
decision taken (Based on the condition)
If the condition is true , it execute one path
of statements , If the condition is false , it
execute another path of instruction.
L.NIVETHA AP/CSE,KNCET
Example : Algorithm to find biggest among two
numbers
Step1: Start the program
Step2: Read the element num1 , num2
Step3: Compare two numbers if( num1 >
num2)
Step4: If the condition true to print num1 is a
biggest number
Step5: If the condition is false to print num2
is a biggest number
Step6: Stop the program
L.NIVETHA AP/CSE,KNCET
In iteration control flow , One or more
instruction executed repeatedly until the
particular condition become false,
Here it check the condition , If it is true
means it execute the group of statement
repeatedly , if the condition become false it
terminate the loop.
L.NIVETHA AP/CSE,KNCET
Step1: Start the program
Step2: Read the element num=5 , sum=0 ,
i=1
Step3: Check the condition while(num >=i):
Step4: if the condition is true do
sum =sum +i
i=i+1
Step5: if the condition false come out from the
loop.
Step6:Print the sum
Step7:Stop the program.
L.NIVETHA AP/CSE,KNCET
 Flowchart is a pictorial representation or
diagrammatic representation of an algorithm.
 A flowchart uses different shaped symbols for
representing different instruction and this
information written into small boxes using
clear statement.
 Here lines and arrow mark represent flow of
operation.
 The purpose of drawing a flowchart is to
represent the logic of the program to clear
manner in visual form.
L.NIVETHA AP/CSE,KNCET
 Program preparation is simplified
 Easier to understand
 Provide effective documentation
 Easy to analyze and compare with various
method
 Reviewing and debugging is easy
L.NIVETHA AP/CSE,KNCET
 Flow lines
 Terminal symbols
 Input/output symbols
 Process symbols
 Decision symbols
 Connectors
L.NIVETHA AP/CSE,KNCET
 The standard symbols only used .
 Arrowhead represent direction of flow control
 Usual procedure of direction is top to bottom
 Only one flow line should come process
symbols and one flow line out from each
symbols.
 <0 >0
=0
L.NIVETHA AP/CSE,KNCET
Three basic structure available There are:
1 . Sequence structure:
Here the steps are executed in a linear
order one after the other,
The steps in the sequence control flow
are executed exactly once
It is simplest method , Here flow is goes
to only one direction that is top to bottom.
L.NIVETHA AP/CSE,KNCET
Selection Structure:
Here the step to be executed based on the
decision taken (Based on the condition)
If the condition is true , it execute one
path of statements , If the condition is false
, it execute another path of instruction.
The following example flowchart
compares two numbers and find the
maximum of two numbers , Decision taken
based on the condition , if the condition is
true it will print a is big , If the condition is
false print b is big then stop the process
L.NIVETHA AP/CSE,KNCET
True False
If
a>
b
Write a
is Big
Write b
is big
stop
Read a,b
start
L.NIVETHA AP/CSE,KNCET
Loop Structure/Iteration Structure:
In iteration control flow , One are more
instruction executed repeatedly until the
particular condition become false,
Here it check the condition , If it is true
means it execute the group of statement
repeatedly , if the condition become false it
terminate the loop.
The following example it check condition
based on decision if true it execute the set of
statement sum=sum+i ,i=i+1 repeatedly , if
the condition is false it print the sum and
stop the process. L.NIVETHA AP/CSE,KNCET
Top tested loop
False
True
start
Sum=sum+i
i=i+1
Read sum , i
, num
While
(num>i
)
Stop
Print the
sum
L.NIVETHA AP/CSE,KNCET
1. To understand the logic clearly
2. Better communication
3. Effective analysis
4. Effective synthesis
5. Effective coding
6. Proper program documentation
7. Systematic Debugging
8. Systematic testing
9. Efficient Program Maintenance.
L.NIVETHA AP/CSE,KNCET
Here the steps are executed in a linear order
one after the other,
The steps in the sequence control flow are
executed exactly once
It is simplest method , Here flow is goes to only
one direction that is top to bottom.
Example: Addition of two numbers
READ the values of a , b
COMPUTE sum= a+b
WRITE sum
STOP
L.NIVETHA AP/CSE,KNCET
Here the step to be executed based on the
decision taken (Based on the condition)
If the condition is true , it execute one path
of statements , If the condition is false , it
execute another path of instruction.
Example:
READ the values of a , b
COMPARE IF(a>b): THEN
IF true WRITE a is biggest
number
ELSE :
WRITE b is biggest number
ENDIF L.NIVETHA AP/CSE,KNCET
In iteration control flow , One are more
instruction executed repeatedly until the
particular condition become false,
Here it check the condition (WHILE()), IF it
is true means it execute the group of
statement repeatedly , IF the condition
become false it terminate the loop.
Example:
READ num , sum ,i
Check WHILE(num>i):
IF true do sum=sum+I
i=i+1
WRITE sum
STOP L.NIVETHA AP/CSE,KNCET
Programming paradigm was defined as
different pattern and models for writing a
program.
The programming paradigm may differ in
the terms of our own idea.
In earlier the unstructured style of
programming was used ,
Here all action are specified into small and
simple program.
L.NIVETHA AP/CSE,KNCET
Programming paradigm can be classified as
follows.
1. Structured programming
2. Object _Oriented programming
3. Aspect_ Oriented Programming
L.NIVETHA AP/CSE,KNCET
Here the problem to be solved by
subdividing the main task into small that can
be written independently.
Once we written the small task , those
task combined together and complete the
main task.
The structured programming written in
two ways:
1. procedural programming
2. modular programming .
L.NIVETHA AP/CSE,KNCET
Here the given task to be divided into
smaller procedure or functions that are
written with in the main function.
This will perform a specific task.
Here a procedure or function called , then
the execution control jumped to
corresponding procedure definition , after
execution control comes back to the called
procedure.
L.NIVETHA AP/CSE,KNCET
Here the large program subdivided
into group of files ,each file consist
of programs that can be executed
independently.
here all the task related to each
other .
example : C , COBOL and Pascal
L.NIVETHA AP/CSE,KNCET
This will developing the program
based on their component objects. the
components interacts with each other
to provide the functionality of the
software.
The terms that are related to OOPS:
1.Class - is the basic building blocks of algorithm.
2.Object - it is run time instances of the class.
3.Abstraction - is the process of picking essential
details from large program and ignore remaining
details.
L.NIVETHA AP/CSE,KNCET
4. Encapsulation - is the process of
implementing abstraction
5.Inheritance - it is a feature application in
C++ I, it will derive a new class from the
base class.
6.Polymorphism – It allows different objects to
respond to the same message in different
ways.
Example: JAVA and C++
L.NIVETHA AP/CSE,KNCET
Aspect oriented programming is a new
technique that handles crosscutting concerns
like logging , authentication, security,
performance.
these aspects not fit into a single module
or related module.
L.NIVETHA AP/CSE,KNCET
L.NIVETHA AP/CSE,KNCET
 Effective Problem formulation is fundamental
to the success of all analysis.
 It is more essential even for small studies ,it
will save time later and help ensure quality.
 There is no universally acceptable approach
to problem formulation.
L.NIVETHA AP/CSE,KNCET
Problem solving is the process of solving
any problem by using following methods.
1. Recognize and understand the problem.
2. Accumulate facts.
3. Select appropriate theory.
4. Make necessary assumptions.
5. Solve the problem.
6. Verify the result.
L.NIVETHA AP/CSE,KNCET
The five steps used in computer for problem
solving:
1. Develop an algorithm and flowchart.
2. Write the program in computer language.
3. Enter the program into computer.
4. Test and debug the program.
5. Run the program ,get input data and get the
result of the program
L.NIVETHA AP/CSE,KNCET
A=10, b=20
C=A+B
Print c
Step – 1 : Start the Program
Step – 2: read the two numbers A,B
Step – 3: Calculate C=A+B
Step – 4: print the calculated value C
Step – 5:Stop the Program
L.NIVETHA AP/CSE,KNCET
A=16
C=A*A
Print C
Step – 1: Start the program
Step - 2:Read the number A
Step – 3:Calculate C=A*A
Step – 4:Print the result C
Step – 5:Stop the program
L.NIVETHA AP/CSE,KNCET
A=5, B=2
C=A*B
Print C
L.NIVETHA AP/CSE,KNCET
Num=100
Sum=0
i=2
While(num>=i)
sum=sum+i
i=i+2
Print(sum)
Sum=1+2+3….+100
Sum=1+3+5+7…99
Sum=2+4+6+8….+100
L.NIVETHA AP/CSE,KNCET
Example :1
Num=5
If(Num%2==0)
printf(“even number”);
Else
printf(“odd number”);
Example 2:
Num=5;
While(Num>=0)
printf(“welcome”);
num=num-1;
L.NIVETHA AP/CSE,KNCET

More Related Content

Similar to U1.ppt

Computer basics and i.o devices
Computer basics and i.o devicesComputer basics and i.o devices
Computer basics and i.o devices
kitturashmikittu
 
Intro to Computing Lec 1.pptx
Intro to Computing Lec 1.pptxIntro to Computing Lec 1.pptx
Intro to Computing Lec 1.pptx
FalakNiaz15
 
Computer Structures
Computer StructuresComputer Structures
Computer Structures
guestfc2f62
 

Similar to U1.ppt (20)

ICT Lecture-1
ICT Lecture-1 ICT Lecture-1
ICT Lecture-1
 
Introduction To Computer Systems
Introduction To Computer SystemsIntroduction To Computer Systems
Introduction To Computer Systems
 
computer Architecture
computer Architecturecomputer Architecture
computer Architecture
 
Computer basics and i.o devices
Computer basics and i.o devicesComputer basics and i.o devices
Computer basics and i.o devices
 
Processing Data
Processing DataProcessing Data
Processing Data
 
Chapter1a
Chapter1aChapter1a
Chapter1a
 
Components of the System Unit.pdf
Components of the System Unit.pdfComponents of the System Unit.pdf
Components of the System Unit.pdf
 
Introduction to Computer System
Introduction to Computer System Introduction to Computer System
Introduction to Computer System
 
Computer Hardware Complete Guide Easy
Computer Hardware Complete Guide EasyComputer Hardware Complete Guide Easy
Computer Hardware Complete Guide Easy
 
The Basic Organization of Computers
The Basic Organization of ComputersThe Basic Organization of Computers
The Basic Organization of Computers
 
unit-i.pdf
unit-i.pdfunit-i.pdf
unit-i.pdf
 
Introduction to 8085 Microprocessor.pptx
Introduction to 8085 Microprocessor.pptxIntroduction to 8085 Microprocessor.pptx
Introduction to 8085 Microprocessor.pptx
 
computer devices and memory unit 2 notes.pdf
computer devices and memory unit 2 notes.pdfcomputer devices and memory unit 2 notes.pdf
computer devices and memory unit 2 notes.pdf
 
Hardware and software of computer
Hardware and software of computerHardware and software of computer
Hardware and software of computer
 
Intro to Computing Lec 1.pptx
Intro to Computing Lec 1.pptxIntro to Computing Lec 1.pptx
Intro to Computing Lec 1.pptx
 
Unit2fit
Unit2fitUnit2fit
Unit2fit
 
Computer Structures
Computer StructuresComputer Structures
Computer Structures
 
Introduction of computer
Introduction of computerIntroduction of computer
Introduction of computer
 
INSTRUCTION TYPES
INSTRUCTION TYPESINSTRUCTION TYPES
INSTRUCTION TYPES
 
module 1 computer architecture diploma
 module 1 computer architecture diploma   module 1 computer architecture diploma
module 1 computer architecture diploma
 

More from Kongunadu College of Engineering and Technology

More from Kongunadu College of Engineering and Technology (19)

Unit V - ppt.pptx
Unit V - ppt.pptxUnit V - ppt.pptx
Unit V - ppt.pptx
 
C++ UNIT4.pptx
C++ UNIT4.pptxC++ UNIT4.pptx
C++ UNIT4.pptx
 
c++ Unit I.pptx
c++ Unit I.pptxc++ Unit I.pptx
c++ Unit I.pptx
 
c++ Unit III - PPT.pptx
c++ Unit III - PPT.pptxc++ Unit III - PPT.pptx
c++ Unit III - PPT.pptx
 
c++ UNIT II.pptx
c++ UNIT II.pptxc++ UNIT II.pptx
c++ UNIT II.pptx
 
UNIT 1.pptx
UNIT 1.pptxUNIT 1.pptx
UNIT 1.pptx
 
UNIT 4.pptx
UNIT 4.pptxUNIT 4.pptx
UNIT 4.pptx
 
UNIT 5.pptx
UNIT 5.pptxUNIT 5.pptx
UNIT 5.pptx
 
UNIT 2.pptx
UNIT 2.pptxUNIT 2.pptx
UNIT 2.pptx
 
UNIT 3.pptx
UNIT 3.pptxUNIT 3.pptx
UNIT 3.pptx
 
Unit - 1.ppt
Unit - 1.pptUnit - 1.ppt
Unit - 1.ppt
 
UNIT 5.pptx
UNIT 5.pptxUNIT 5.pptx
UNIT 5.pptx
 
Unit - 2.ppt
Unit - 2.pptUnit - 2.ppt
Unit - 2.ppt
 
Unit - 3.pptx
Unit - 3.pptxUnit - 3.pptx
Unit - 3.pptx
 
Unit - 4.ppt
Unit - 4.pptUnit - 4.ppt
Unit - 4.ppt
 
U2.ppt
U2.pptU2.ppt
U2.ppt
 
U4.ppt
U4.pptU4.ppt
U4.ppt
 
U5 SPC.pptx
U5 SPC.pptxU5 SPC.pptx
U5 SPC.pptx
 
U3.pptx
U3.pptxU3.pptx
U3.pptx
 

Recently uploaded

FULL ENJOY Call Girls In Mahipalpur Delhi Contact Us 8377877756
FULL ENJOY Call Girls In Mahipalpur Delhi Contact Us 8377877756FULL ENJOY Call Girls In Mahipalpur Delhi Contact Us 8377877756
FULL ENJOY Call Girls In Mahipalpur Delhi Contact Us 8377877756
dollysharma2066
 
Structural Analysis and Design of Foundations: A Comprehensive Handbook for S...
Structural Analysis and Design of Foundations: A Comprehensive Handbook for S...Structural Analysis and Design of Foundations: A Comprehensive Handbook for S...
Structural Analysis and Design of Foundations: A Comprehensive Handbook for S...
Dr.Costas Sachpazis
 
Call Now ≽ 9953056974 ≼🔝 Call Girls In New Ashok Nagar ≼🔝 Delhi door step de...
Call Now ≽ 9953056974 ≼🔝 Call Girls In New Ashok Nagar  ≼🔝 Delhi door step de...Call Now ≽ 9953056974 ≼🔝 Call Girls In New Ashok Nagar  ≼🔝 Delhi door step de...
Call Now ≽ 9953056974 ≼🔝 Call Girls In New Ashok Nagar ≼🔝 Delhi door step de...
9953056974 Low Rate Call Girls In Saket, Delhi NCR
 
VIP Call Girls Ankleshwar 7001035870 Whatsapp Number, 24/07 Booking
VIP Call Girls Ankleshwar 7001035870 Whatsapp Number, 24/07 BookingVIP Call Girls Ankleshwar 7001035870 Whatsapp Number, 24/07 Booking
VIP Call Girls Ankleshwar 7001035870 Whatsapp Number, 24/07 Booking
dharasingh5698
 
Call for Papers - African Journal of Biological Sciences, E-ISSN: 2663-2187, ...
Call for Papers - African Journal of Biological Sciences, E-ISSN: 2663-2187, ...Call for Papers - African Journal of Biological Sciences, E-ISSN: 2663-2187, ...
Call for Papers - African Journal of Biological Sciences, E-ISSN: 2663-2187, ...
Christo Ananth
 
result management system report for college project
result management system report for college projectresult management system report for college project
result management system report for college project
Tonystark477637
 

Recently uploaded (20)

FULL ENJOY Call Girls In Mahipalpur Delhi Contact Us 8377877756
FULL ENJOY Call Girls In Mahipalpur Delhi Contact Us 8377877756FULL ENJOY Call Girls In Mahipalpur Delhi Contact Us 8377877756
FULL ENJOY Call Girls In Mahipalpur Delhi Contact Us 8377877756
 
data_management_and _data_science_cheat_sheet.pdf
data_management_and _data_science_cheat_sheet.pdfdata_management_and _data_science_cheat_sheet.pdf
data_management_and _data_science_cheat_sheet.pdf
 
PVC VS. FIBERGLASS (FRP) GRAVITY SEWER - UNI BELL
PVC VS. FIBERGLASS (FRP) GRAVITY SEWER - UNI BELLPVC VS. FIBERGLASS (FRP) GRAVITY SEWER - UNI BELL
PVC VS. FIBERGLASS (FRP) GRAVITY SEWER - UNI BELL
 
(INDIRA) Call Girl Bhosari Call Now 8617697112 Bhosari Escorts 24x7
(INDIRA) Call Girl Bhosari Call Now 8617697112 Bhosari Escorts 24x7(INDIRA) Call Girl Bhosari Call Now 8617697112 Bhosari Escorts 24x7
(INDIRA) Call Girl Bhosari Call Now 8617697112 Bhosari Escorts 24x7
 
Structural Analysis and Design of Foundations: A Comprehensive Handbook for S...
Structural Analysis and Design of Foundations: A Comprehensive Handbook for S...Structural Analysis and Design of Foundations: A Comprehensive Handbook for S...
Structural Analysis and Design of Foundations: A Comprehensive Handbook for S...
 
UNIT - IV - Air Compressors and its Performance
UNIT - IV - Air Compressors and its PerformanceUNIT - IV - Air Compressors and its Performance
UNIT - IV - Air Compressors and its Performance
 
Vivazz, Mieres Social Housing Design Spain
Vivazz, Mieres Social Housing Design SpainVivazz, Mieres Social Housing Design Spain
Vivazz, Mieres Social Housing Design Spain
 
chapter 5.pptx: drainage and irrigation engineering
chapter 5.pptx: drainage and irrigation engineeringchapter 5.pptx: drainage and irrigation engineering
chapter 5.pptx: drainage and irrigation engineering
 
Java Programming :Event Handling(Types of Events)
Java Programming :Event Handling(Types of Events)Java Programming :Event Handling(Types of Events)
Java Programming :Event Handling(Types of Events)
 
The Most Attractive Pune Call Girls Budhwar Peth 8250192130 Will You Miss Thi...
The Most Attractive Pune Call Girls Budhwar Peth 8250192130 Will You Miss Thi...The Most Attractive Pune Call Girls Budhwar Peth 8250192130 Will You Miss Thi...
The Most Attractive Pune Call Girls Budhwar Peth 8250192130 Will You Miss Thi...
 
Call Now ≽ 9953056974 ≼🔝 Call Girls In New Ashok Nagar ≼🔝 Delhi door step de...
Call Now ≽ 9953056974 ≼🔝 Call Girls In New Ashok Nagar  ≼🔝 Delhi door step de...Call Now ≽ 9953056974 ≼🔝 Call Girls In New Ashok Nagar  ≼🔝 Delhi door step de...
Call Now ≽ 9953056974 ≼🔝 Call Girls In New Ashok Nagar ≼🔝 Delhi door step de...
 
NFPA 5000 2024 standard .
NFPA 5000 2024 standard                                  .NFPA 5000 2024 standard                                  .
NFPA 5000 2024 standard .
 
CCS335 _ Neural Networks and Deep Learning Laboratory_Lab Complete Record
CCS335 _ Neural Networks and Deep Learning Laboratory_Lab Complete RecordCCS335 _ Neural Networks and Deep Learning Laboratory_Lab Complete Record
CCS335 _ Neural Networks and Deep Learning Laboratory_Lab Complete Record
 
Roadmap to Membership of RICS - Pathways and Routes
Roadmap to Membership of RICS - Pathways and RoutesRoadmap to Membership of RICS - Pathways and Routes
Roadmap to Membership of RICS - Pathways and Routes
 
Call for Papers - International Journal of Intelligent Systems and Applicatio...
Call for Papers - International Journal of Intelligent Systems and Applicatio...Call for Papers - International Journal of Intelligent Systems and Applicatio...
Call for Papers - International Journal of Intelligent Systems and Applicatio...
 
VIP Call Girls Ankleshwar 7001035870 Whatsapp Number, 24/07 Booking
VIP Call Girls Ankleshwar 7001035870 Whatsapp Number, 24/07 BookingVIP Call Girls Ankleshwar 7001035870 Whatsapp Number, 24/07 Booking
VIP Call Girls Ankleshwar 7001035870 Whatsapp Number, 24/07 Booking
 
Call Girls Pimpri Chinchwad Call Me 7737669865 Budget Friendly No Advance Boo...
Call Girls Pimpri Chinchwad Call Me 7737669865 Budget Friendly No Advance Boo...Call Girls Pimpri Chinchwad Call Me 7737669865 Budget Friendly No Advance Boo...
Call Girls Pimpri Chinchwad Call Me 7737669865 Budget Friendly No Advance Boo...
 
Call for Papers - African Journal of Biological Sciences, E-ISSN: 2663-2187, ...
Call for Papers - African Journal of Biological Sciences, E-ISSN: 2663-2187, ...Call for Papers - African Journal of Biological Sciences, E-ISSN: 2663-2187, ...
Call for Papers - African Journal of Biological Sciences, E-ISSN: 2663-2187, ...
 
Thermal Engineering -unit - III & IV.ppt
Thermal Engineering -unit - III & IV.pptThermal Engineering -unit - III & IV.ppt
Thermal Engineering -unit - III & IV.ppt
 
result management system report for college project
result management system report for college projectresult management system report for college project
result management system report for college project
 

U1.ppt

  • 2. Computer System – CPU – Memory Unit – Data Representation – Number System and Conversion – Programming Fundamentals – Program Development Life Cycle – Algorithm – Control Structures – Flow Chart – Pseudo code – Programming Paradigms – Problem Formulation and Problem Solving. L.NIVETHA AP/CSE,KNCET
  • 3. Computer is an electronic device that accept data and process those data’s to perform mathematical and logical operation also provide desired output . The computer system consist of four parts: 1. Hardware, 2. Software, 3. Data, 4. Users. L.NIVETHA AP/CSE,KNCET
  • 4. Hardware Consist of mechanical parts that make up the computer as a machine. The hardware consist of physical devices of the computer, computer system having input , output, storage and processing of data. Example: Keyboard, Monitor, RAM, Hard disk, Printer, Processor……etc L.NIVETHA AP/CSE,KNCET
  • 5. Software is a set of instruction that is used to perform the user task’s. Program also set of instruction that written by using some programming languages that is understood by the computer also solve the specified task. The hardware components of the system cannot perform any task without the use of software. There are two types of software: 1. System Software - Windows , Linux … etc 2. Application Software - Ms Office, C, C++ ….. etc L.NIVETHA AP/CSE,KNCET
  • 6. The data is provided as a input to the computer system , Which is processed and generate meaningful information, System that accept the data as Alphabets A…. Z, and Numbers 0…..9. with the use of Keyboard. L.NIVETHA AP/CSE,KNCET
  • 7. Users are peoples who write the computer program or interact with the computer Those are called as Programmers, Data Entry operators, System analyst and Computer Hardware Engineer comes under the users of the computer system. L.NIVETHA AP/CSE,KNCET
  • 8. The Computer system having three major components. 1. Input/Output(I/O)unit 2. Central Processing Unit 3.Memory Unit L.NIVETHA AP/CSE,KNCET
  • 9. Input/ Output Unit The user interact with the computer through the I/O unit. The input unit accepts the data from the user through input devices like keyboard, mouse, scanner … etc The output unit provides the processed data through monitor, printer … etc Central processing unit: Central processing unit or processor called as a brain of the computer, it consist of control unit, ALU, and set of Registers. Memory: the memory unit consist of cache memory and primary memory these memory are used to store the data when the processing of instruction. L.NIVETHA AP/CSE,KNCET
  • 10. Central Processing Unit or the processor called as a brain of the computer, it consist of control unit, Arithmetic Logic Unit, and set of Registers which are temporary storage areas for holding data and instruction. ALU perform arithmetic and logical Operation, CU Control unit controls and Coordinate the activity of other units. L.NIVETHA AP/CSE,KNCET
  • 11. CONTROL UNIT ARITHMETIC AND LOGIC UNIT REGISTERS CENTRAL PROCESSING UNIT L.NIVETHA AP/CSE,KNCET
  • 12. CPU Executes the stored program instructions, those instruction and data stored in memory before execution. It interprets the instruction and perform the arithmetic and logic operation and send the processed data or results into memory. CPU also act as a administrator and responsible for supervising operations of other parts of the computer. L.NIVETHA AP/CSE,KNCET
  • 13. ALU consist of two units – arithmetic unit and logic unit. Arithmetic unit performs arithmetic operations on the given data like addition, subtraction, Multiplication, Division… The logic unit of ALU is responsible for performing logical operation. It will perform the logical operation based on the user Expression. Testing also performed by using Relational Operator. The ALU perform arithmetic logic operation and store the processed results into memory. L.NIVETHA AP/CSE,KNCET
  • 14. Registers are high speed storage areas with in the CPU. But having less storage capacity. Registers not having any address location but register instruction directly accessed by the CPU. It store data instructions and addresses and intermediate results of processing. Before processing of any logics we need data and program instruction within the register. CPU having different register each register serving a specific purposes. L.NIVETHA AP/CSE,KNCET
  • 15. PC IR MAR ACC MBR DR L.NIVETHA AP/CSE,KNCET
  • 16.  ACC – Accumulator it stores the result of arithmetic and logic operation.  IC – Instruction Register it stores current instruction most recently used.  PC – Program Counter contains the address of next instruction to be processed.  MAR – Memory address Register contains address of next location in the memory to be accessed.  MBR – Memory Buffer Register Temporarily stores data from memory or data store to the memory.  DR - Data Register it stores variable and any other data. L.NIVETHA AP/CSE,KNCET
  • 17.  The control unit does not do any operation but it organize the processing of data and instruction.  It act as a Supervisor and controls the activity of other units in the computer.  Control Unit directs the computer to carryout stored program instruction by communicating with ALU and registers.  CU also holds the CPU’s instruction set. L.NIVETHA AP/CSE,KNCET
  • 18. Memory unit used to store the instruction, data, images and video….etc There are following memory available in the system 1. Cache Memory - Storage Buffer 2. Primary Memory(volatile memory) - RAM and ROM 3. Secondary Memory(Non Volatile Memory) - Hard disk, Memory Cards…etc L.NIVETHA AP/CSE,KNCET
  • 19. Cache memory is a very high speed memory placed in between RAM and CPU. The cache memory increases the speed of processing. Cache memory is a storage buffer that stores the data and used by the CPU, At first the CPU will check any data in cache memory if not found then ask data from RAM. Cache memory is build-in into processor, located between CPU and RAM memory. L.NIVETHA AP/CSE,KNCET
  • 20. The CPU has a build-in Level1(L1) Cache and Level2(L2) Cache. In addition of L1 and L2 Cache, some CPU,s have separate cache chip on the motherboard called (L3) cache. These cache stores the recently used instruction. Cache Memory is very expensive, so it is small in size, computer have cache memory size 256KB to 2MB L.NIVETHA AP/CSE,KNCET
  • 21. Primary Memory: Primary memory is called as main memory, It is used to store data and information's during the processing of data. Primary memory is a semiconductor memory. Primary memory is two kinds RAM and ROM. RAM Random Access Memory is a volatile memory, the information stored in RAM gets erased when the computer is turned off. L.NIVETHA AP/CSE,KNCET
  • 22. The ROM is a non volatile memory, but it is a read only memory. the storage in ROM is permanent in nature, the instruction are written by the manufacturer itself. The input data entered through input devices are stored in RAM, also processed output data also stored in RAM. RAM having limited storage capacity, due to its high cost. Data flow: Hard disk - RAM - Cache - CPU. L.NIVETHA AP/CSE,KNCET
  • 23. Secondary Memory: The secondary memory stores data and instruction permanently. The information stored in secondary memory for long time and is generally permanent in nature unless erased by the user. It is a non volatile memory. It provide backup storage for data and instruction. the secondary memory has a high storage capacity than the primary memory. L.NIVETHA AP/CSE,KNCET
  • 24. secondary memory is also cheaper than the main memory. the stored data in the secondary devise currently not used by CPU, but it may be required in later use. It take longer time to access the data and instruction. L.NIVETHA AP/CSE,KNCET
  • 25. The data stored in a computer may be of different kinds 1. Numerical data – (1,2,3……9) 2. Alphabetic data – (a,b………z) 3. Alphanumeric data – it is a combination of (A,B…….Z ) and Numbers (1,2,3……….9). All kind of data is represented in terms of 0’s and 1’s in the computer. Each symbol is represented as unique notation. L.NIVETHA AP/CSE,KNCET
  • 26. The following number system are used in the computer: 1. Decimal number system 2. Octal number system 3. Binary number system 4. Hexadecimal number system. L.NIVETHA AP/CSE,KNCET
  • 27. Decimal number system: It consist of 10 digits - 0,1,2,3…..9 All the numbers in decimal are represented within 0…9 for example : 3425 The base value of decimal is 10 Octal Number System: The octal number system consist of eight digit - 0……7 All the number in octal represented in eight digit Example: 0,1……7 The base value of octal is 8 L.NIVETHA AP/CSE,KNCET
  • 28. Binary Number System: The Binary number system consist of two digit – 0, 1 All the binary number are represented in this two digits Example: 010010 The base value of binary is 2 Hexadecimal number system: The hexadecimal number system consist of sixteen digits - 0….9 A,B,C,D,E,F All the hexadecimal number are represented using this sixteen digit Example: 9A67E. The base value of hexadecimal is 16 L.NIVETHA AP/CSE,KNCET
  • 29. To convert one number system to another number system is called number conversion. There are 12 conversion is possible there are: 1. Decimal to binary, Octal, Hexadecimal 2. binary, Octal, Hexadecimal to Decimal 3. Others to Others (without combination of decimal) L.NIVETHA AP/CSE,KNCET
  • 44. Computer is an electronic device that accepts data, processes it , and generate relevant output. It can perform both simple and complex task. But the computer cannot perform any task it’s own. computer is need some instruction how to process the specified task to be performed. The set of instruction that instruct the computer about way to task to be performed is called program. L.NIVETHA AP/CSE,KNCET
  • 45. A program is required for all kind of tasks like simple task to perform arithmetic calculation and complex task like gaming. Through this program to perform all kind of task. L.NIVETHA AP/CSE,KNCET
  • 46. PROGRAM DEVELOPMENT LIFE CYCLE Presented by, L.Nivetha,AP/CSE, KNCET KONGUNADU COLLEGE OF ENGINEERING AND TECHNOLOGY (AUTONOMOUS) NAMAKKAL - TRICHY MAIN ROAD, THOTTIAM, TRICHY-621 215 L.NIVETHA AP/CSE,KNCET
  • 47. A program is needed to instruct the computer about the way a task is to be performed. The instruction in a program have three essential part. 1. Instructions to accept the input data that needs to be processed. 2. Instruction that act as a input data and process it. 3. instruction to provide the output to user. L.NIVETHA AP/CSE,KNCET
  • 48. The instruction in a program are defined in a specific sequence. A program is write by a programmer based on the program Development Life Cycle. Program Analysis Program Development Program Design Program development life cycle Program Documentation and Maintenance L.NIVETHA AP/CSE,KNCET
  • 49. The programmer first understand the problem to be solved. The programmer find out the different ways the problem can be solved, and decide the best solving solution which will be followed to solve the problem L.NIVETHA AP/CSE,KNCET
  • 50. The selected solution is represented in form, then it will be coded. This require three types: 1. An algorithm is written, Which is in simple English. 2. A flowchart is drawn, which is the diagrammatic representation of a solution. It is easy to understand. 3. A Pseudo code is written, Pseudo code uses the structured program construct . L.NIVETHA AP/CSE,KNCET
  • 51. Definition: Algorithm is an ordered sequence of finite, well defined, unambiguous instruction for completing task. Algorithm is defined as a step by step procedure for solving any problem . It is one of the basic tools used to develop the problem solving . It is also a precise rule to specifying how to solve a problem. L.NIVETHA AP/CSE,KNCET
  • 52. Example: ALGORITHM FOR AREA OF CIRCLE STEP-1: Start the program STEP-2: Read the value of radius r STEP-3: Calculate Area=3.14*r*r STEP-4: Print the area of circle STEP-5: Stop the program L.NIVETHA AP/CSE,KNCET
  • 53. Example: ALGORITHM FOR AREA OF CIRCLE STEP-1: Start the program STEP-2: Read the value of radius r STEP-3: Calculate Area=3.14*r*r STEP-4: Print the area of circle STEP-5: Stop the program L.NIVETHA AP/CSE,KNCET
  • 54.  Flowchart is a pictorial representation or diagrammatic representation of an algorithm.  A flowchart uses different shaped symbols for representing different instruction and this information written into small boxes using clear statement.  Here lines and arrow mark represent flow of operation.  The purpose of drawing a flowchart is to represent the logic of the program to clear manner in visual form. L.NIVETHA AP/CSE,KNCET
  • 55.  Flow lines  Terminal symbols  Input/output symbols  Process symbols  Decision symbols  Connectors L.NIVETHA AP/CSE,KNCET
  • 56. Example : Addition of two numbers start C=a+b Read a b Write c stop L.NIVETHA AP/CSE,KNCET
  • 57.  Pseudo code is also a formal design tool.  Pseudo code consist of short , readable and written in normal English used to explain an algorithm.  Pseudo code does not include details like variable declaration , subroutines …  It is a short hand way of describing the computer program  It is easier for programmer or non programmer to understand the general working of the computer program .  Pseudo code cannot be compiled or executed L.NIVETHA AP/CSE,KNCET
  • 58. Rules for writing Pseudocode: 1. Pseudo code written in structured English 2. Write one statement per line 3. Capitalize Keywords – READ,WRITE,IF, ENDIF, WHILE , UNTIL. 4. Indent to show hierarchy 5. End with multiline structure 6. Keep statements Language independent Input: READ , GET , INPUT Output: OUTPUT , PRINT , DISPLAY. Calculation: COMPUTE , CALCULATE , ADD …etc Increment : INCREMENT. L.NIVETHA AP/CSE,KNCET
  • 59. 3.PROGRAM DEVELOPMENT The computer programming languages are different kinds, low level and high level languages like C, C++, Java, ,,,etc Based on the programming language first to write a pseudo code. Using this pseudo code to write the program based on the language instruction. These program compiled for any syntax error. Syntax errors arise due to incorrect use of the programming language. The successfully compiled program to be executed When the time of execution to give input data that will be processed and produce the corresponding output. L.NIVETHA AP/CSE,KNCET
  • 60. 4.Testing the program: Testing is the process of verify the expected result is came or not. 5.Program Documentation and Maintenance. The program is properly documented, so that later on any one can use it and understand it’s working. Any changes made in the program, after installation due to add some features in the application is called maintenance. L.NIVETHA AP/CSE,KNCET
  • 61. • An Algorithm contains step by step effective information, It is not a computer program ,It is one of the basic tool in problem solving. Characteristics:  Algorithm has a finite number of inputs.  Every instruction should be precise and unambiguous.  It looks like a normal English.  Effectiveness of each step is very important.  The desired output must obtained only after the algorithm terminates.  The algorithm should written in sequence. L.NIVETHA AP/CSE,KNCET
  • 62. Different algorithm may perform the same task with different set of instruction. Some algorithm is better than the other in solving problem. The following factors that determine the Quality of algorithm are : 1.Time 2. Memory 3. Accuracy 4. Sequence 5. Generability L.NIVETHA AP/CSE,KNCET
  • 63. Control flow is defined as each and every program having it’s own logic’s , Based on this logic the control flow vary from one program to another . The basic control flow needed for writing good and efficient algorithm there are. 1. Sequence Control Flow 2. Selection Control Flow 3. Iteration (Looping ) Control Flow L.NIVETHA AP/CSE,KNCET
  • 64. Here the instructions are executed in a linear order one after the other, The instruction in sequence control flow are executed exactly once Example: Step1: start the program Step2: Read the element num1 , num2 Step3: Calculate sum=num1 + num2 Step4: Print the sum Step5: stop the program L.NIVETHA AP/CSE,KNCET
  • 65. Here the step to be executed based on the decision taken (Based on the condition) If the condition is true , it execute one path of statements , If the condition is false , it execute another path of instruction. L.NIVETHA AP/CSE,KNCET
  • 66. Example : Algorithm to find biggest among two numbers Step1: Start the program Step2: Read the element num1 , num2 Step3: Compare two numbers if( num1 > num2) Step4: If the condition true to print num1 is a biggest number Step5: If the condition is false to print num2 is a biggest number Step6: Stop the program L.NIVETHA AP/CSE,KNCET
  • 67. In iteration control flow , One or more instruction executed repeatedly until the particular condition become false, Here it check the condition , If it is true means it execute the group of statement repeatedly , if the condition become false it terminate the loop. L.NIVETHA AP/CSE,KNCET
  • 68. Step1: Start the program Step2: Read the element num=5 , sum=0 , i=1 Step3: Check the condition while(num >=i): Step4: if the condition is true do sum =sum +i i=i+1 Step5: if the condition false come out from the loop. Step6:Print the sum Step7:Stop the program. L.NIVETHA AP/CSE,KNCET
  • 69.  Flowchart is a pictorial representation or diagrammatic representation of an algorithm.  A flowchart uses different shaped symbols for representing different instruction and this information written into small boxes using clear statement.  Here lines and arrow mark represent flow of operation.  The purpose of drawing a flowchart is to represent the logic of the program to clear manner in visual form. L.NIVETHA AP/CSE,KNCET
  • 70.  Program preparation is simplified  Easier to understand  Provide effective documentation  Easy to analyze and compare with various method  Reviewing and debugging is easy L.NIVETHA AP/CSE,KNCET
  • 71.  Flow lines  Terminal symbols  Input/output symbols  Process symbols  Decision symbols  Connectors L.NIVETHA AP/CSE,KNCET
  • 72.  The standard symbols only used .  Arrowhead represent direction of flow control  Usual procedure of direction is top to bottom  Only one flow line should come process symbols and one flow line out from each symbols.  <0 >0 =0 L.NIVETHA AP/CSE,KNCET
  • 73. Three basic structure available There are: 1 . Sequence structure: Here the steps are executed in a linear order one after the other, The steps in the sequence control flow are executed exactly once It is simplest method , Here flow is goes to only one direction that is top to bottom. L.NIVETHA AP/CSE,KNCET
  • 74. Selection Structure: Here the step to be executed based on the decision taken (Based on the condition) If the condition is true , it execute one path of statements , If the condition is false , it execute another path of instruction. The following example flowchart compares two numbers and find the maximum of two numbers , Decision taken based on the condition , if the condition is true it will print a is big , If the condition is false print b is big then stop the process L.NIVETHA AP/CSE,KNCET
  • 75. True False If a> b Write a is Big Write b is big stop Read a,b start L.NIVETHA AP/CSE,KNCET
  • 76. Loop Structure/Iteration Structure: In iteration control flow , One are more instruction executed repeatedly until the particular condition become false, Here it check the condition , If it is true means it execute the group of statement repeatedly , if the condition become false it terminate the loop. The following example it check condition based on decision if true it execute the set of statement sum=sum+i ,i=i+1 repeatedly , if the condition is false it print the sum and stop the process. L.NIVETHA AP/CSE,KNCET
  • 77. Top tested loop False True start Sum=sum+i i=i+1 Read sum , i , num While (num>i ) Stop Print the sum L.NIVETHA AP/CSE,KNCET
  • 78. 1. To understand the logic clearly 2. Better communication 3. Effective analysis 4. Effective synthesis 5. Effective coding 6. Proper program documentation 7. Systematic Debugging 8. Systematic testing 9. Efficient Program Maintenance. L.NIVETHA AP/CSE,KNCET
  • 79. Here the steps are executed in a linear order one after the other, The steps in the sequence control flow are executed exactly once It is simplest method , Here flow is goes to only one direction that is top to bottom. Example: Addition of two numbers READ the values of a , b COMPUTE sum= a+b WRITE sum STOP L.NIVETHA AP/CSE,KNCET
  • 80. Here the step to be executed based on the decision taken (Based on the condition) If the condition is true , it execute one path of statements , If the condition is false , it execute another path of instruction. Example: READ the values of a , b COMPARE IF(a>b): THEN IF true WRITE a is biggest number ELSE : WRITE b is biggest number ENDIF L.NIVETHA AP/CSE,KNCET
  • 81. In iteration control flow , One are more instruction executed repeatedly until the particular condition become false, Here it check the condition (WHILE()), IF it is true means it execute the group of statement repeatedly , IF the condition become false it terminate the loop. Example: READ num , sum ,i Check WHILE(num>i): IF true do sum=sum+I i=i+1 WRITE sum STOP L.NIVETHA AP/CSE,KNCET
  • 82. Programming paradigm was defined as different pattern and models for writing a program. The programming paradigm may differ in the terms of our own idea. In earlier the unstructured style of programming was used , Here all action are specified into small and simple program. L.NIVETHA AP/CSE,KNCET
  • 83. Programming paradigm can be classified as follows. 1. Structured programming 2. Object _Oriented programming 3. Aspect_ Oriented Programming L.NIVETHA AP/CSE,KNCET
  • 84. Here the problem to be solved by subdividing the main task into small that can be written independently. Once we written the small task , those task combined together and complete the main task. The structured programming written in two ways: 1. procedural programming 2. modular programming . L.NIVETHA AP/CSE,KNCET
  • 85. Here the given task to be divided into smaller procedure or functions that are written with in the main function. This will perform a specific task. Here a procedure or function called , then the execution control jumped to corresponding procedure definition , after execution control comes back to the called procedure. L.NIVETHA AP/CSE,KNCET
  • 86. Here the large program subdivided into group of files ,each file consist of programs that can be executed independently. here all the task related to each other . example : C , COBOL and Pascal L.NIVETHA AP/CSE,KNCET
  • 87. This will developing the program based on their component objects. the components interacts with each other to provide the functionality of the software. The terms that are related to OOPS: 1.Class - is the basic building blocks of algorithm. 2.Object - it is run time instances of the class. 3.Abstraction - is the process of picking essential details from large program and ignore remaining details. L.NIVETHA AP/CSE,KNCET
  • 88. 4. Encapsulation - is the process of implementing abstraction 5.Inheritance - it is a feature application in C++ I, it will derive a new class from the base class. 6.Polymorphism – It allows different objects to respond to the same message in different ways. Example: JAVA and C++ L.NIVETHA AP/CSE,KNCET
  • 89. Aspect oriented programming is a new technique that handles crosscutting concerns like logging , authentication, security, performance. these aspects not fit into a single module or related module. L.NIVETHA AP/CSE,KNCET
  • 91.  Effective Problem formulation is fundamental to the success of all analysis.  It is more essential even for small studies ,it will save time later and help ensure quality.  There is no universally acceptable approach to problem formulation. L.NIVETHA AP/CSE,KNCET
  • 92. Problem solving is the process of solving any problem by using following methods. 1. Recognize and understand the problem. 2. Accumulate facts. 3. Select appropriate theory. 4. Make necessary assumptions. 5. Solve the problem. 6. Verify the result. L.NIVETHA AP/CSE,KNCET
  • 93. The five steps used in computer for problem solving: 1. Develop an algorithm and flowchart. 2. Write the program in computer language. 3. Enter the program into computer. 4. Test and debug the program. 5. Run the program ,get input data and get the result of the program L.NIVETHA AP/CSE,KNCET
  • 94. A=10, b=20 C=A+B Print c Step – 1 : Start the Program Step – 2: read the two numbers A,B Step – 3: Calculate C=A+B Step – 4: print the calculated value C Step – 5:Stop the Program L.NIVETHA AP/CSE,KNCET
  • 95. A=16 C=A*A Print C Step – 1: Start the program Step - 2:Read the number A Step – 3:Calculate C=A*A Step – 4:Print the result C Step – 5:Stop the program L.NIVETHA AP/CSE,KNCET
  • 98. Example :1 Num=5 If(Num%2==0) printf(“even number”); Else printf(“odd number”); Example 2: Num=5; While(Num>=0) printf(“welcome”); num=num-1; L.NIVETHA AP/CSE,KNCET