Programming Logic
& practices
DCA SYLLABUS
• Introduction to programing
• Define software
• Algorithm
• Flowchart
• Pseudo code
• Coding
• Compiling
• Decimation
• Manteca
What is programming?
• A computer program is a collection of instructions that
performs a specific task when executed by a computer
• A computer requires programed to function
• Executes the programs instructions in the CPU
Software
• Set of instructions or program that says a System to perform a
task
Phases of program
1. Problem identification
2. Preparing algorisms and flowchart
3. Coding
4. Translartion
5. Debugging
6. Execution & test
7. Documentation
Problem Identification
• Here we identify the problems
It involves two major steps:
• identifying inputs, processing steps and outputs
• split the large problem into a series of sub-problems (structured
diagram).
Algorithms
• An algorithm is a procedure in problem solving. It involves a
series of steps.
• One of the major problem in algorithm is Danger of making
errors.
Example
• Q:print the average of three numbers
Step 1: START
Step 2: Enter A,B,C
Step 3: avg=(a+b+c)/3
Step 4:print average
Step 5: STOP
Flowchart
• A pictorial representation of an algorithm
• It show the flow of the program
Components of flowchart
Symbols Stands for
Start/End
flow
Input/output
process
Deception/condition
connectors
Example
Start
Input
A,B,C
Avg=(A+B+
C)/3
Print
Average
stop
Step 1: START
Step 2: Enter A,B,C
Step 3: avg=(a+b+c)/3
Step 4:print average
Step 5: STOP
Example
Start
Input
A,B,C
Avg=(A+B+
C)/3
Print
Average
stop
Step 1: START
Step 2: Enter A,B,C
Step 3: avg=(a+b+c)/3
Step 4:print average
Step 5: STOP
Pseudo code
• Pseudo code is a description of what a computer program or
algorithm must do, expressed in a formally-styled natural
language rather than in a programming language. Pseudo
code is sometimes used as a detailed step in the process of
developing a program.
• Examples:
• 1.. If student's grade is greater than or equal to 60
• Print "passed"
• else
• Print "failed"
• 2
Coding
• A set of instructions expressed in any programing language is
known as code
• Writing a code is called coding
• he process of designing, writing, testing, and maintaining the
source code of computer programs.
• We develop the code with the help of flowchart
Example ( in c )
#include<stdio.h>
Void main()
{
Int A,B,C;
Scanf(“%d,%d,%d”,&A,&B,&C);
Avg=(A+B+C)/3;
printf(“%d”,avg);
}
Start
Input
A,B,C
Avg=(A+B
+C)/3
Print
Averag
e
stop
OUTPUT
2 4 6
3
TRANSLATION/COMPLATION
• The process to convert the written program from high level
language to low level language
Source
code
compil
er
Machine
language
Debugging
• Process that detect the problems or errors in a code
Types of Errors
• Syntax error
• Logical error
• Runtime error
Execution and testing
• The process that found the result / output of the code
documentation
• Last step in processing
• Writing the process and store as a document
Maintenance
• Make change in the given codes
Programming logic &practices
Programming logic &practices

Programming logic &practices