2. Unit 1: Programming Process
Developing a program, program development cycle; Introduction to
Algorithms, Characteristics, writing an algorithm; Flowchart, Symbols,
guidelines for preparing flowchart, benefits of flowcharts, limitations
of flowcharts; Pseudo code, Pseudo code guidelines, benefits of
pseudo code, limitations of pseudo code; Number System
conversion.
Dr.M.Sudharsan 2
3. Topic 1 : Developing a Program
PROGRAM
A computer program, or just a program, is a sequence of instructions, written to perform a specified task
on a computer.A computer requires programs to function, typically executing the program's instructions
in a central processor.
The program has an executable form that the computer can use directly to execute the instructions.
The same program in its human-readable source code form, from which executable programs are
derived (e.g., Compiled), enables a programmer to study and develop its algorithms.
A collection of computer programs and related data is referred to as the software.
Computer source code is typically written by computer programmers
Dr.M.Sudharsan 3
4. PROGRAMMING
Computer programming (often shortened to programming) is a process that leads from an original
formulation of a computing problem to executable computer programs.
Programming involves activities such as analysis, developing understanding, generating
algorithms, verification of requirements of algorithms including their correctness and resources
consumption, and implementation (commonly referred to as coding) of algorithms in a target
programming language.
Source code is written in one or more programming languages.
The purpose of programming is to find a sequence of instructions that will automate performing a
specific task or solving a given problem.
Dr.M.Sudharsan 4
5. DEVELOPING A PROGRAM
Program development is an ongoing systematic process that professionals
follow as they plan, implement and evaluate problem statement.
The process is not confined to a planning cycle.
It can be applied on a small scale to an individual program; on a larger scale
to an entire enterprise level software.
The scope may be different but the principles of program development
remain the same.
Dr.M.Sudharsan 5
6. Topic 2 : Program development Life cycle
when we want to develop a program using any programming language, we follow a sequence of
steps. These steps are called phases in program development. The program development life
cycle is a set of steps or phases that are used to develop a program in any programming
language.
Generally, program development life cycle contains 6 phases, they are as follow
• Problem Definition
• Problem Analysis
• Algorithm Development
• Coding & Documentation
• Testing & Debugging
• Maintenance
Dr.M.Sudharsan 6
8. • 1. Problem Definition
In this phase, we define the problem statement and we decide the boundaries of the problem.
In this phase we need to understand the problem statement, what is our requirement, what should be
the output of the problem solution. These are defined in this first phase of the program development
life cycle.
• 2. Problem Analysis
In phase 2, we determine the requirements like variables, functions, etc. to solve the
problem. That means we gather the required resources to solve the problem defined in the problem
definition phase. We also determine the bounds of the solution.
Dr.M.Sudharsan 8
9. 3. Algorithm Development
During this phase, we develop a step by step procedure to solve the problem using the
specification given in the previous phase. This phase is very important for program
development. That means we write the solution in step by step statements.
4. Coding & Documentation
This phase uses a programming language to write or implement actual programming
instructions for the steps defined in the previous phase. In this phase, we construct actual
program. That means we write the program to solve the given problem using programming
languages like C, C++,
Java, Forex programming languages like our (mt4 and/or mt5) language(s), etc.,
Dr.M.Sudharsan 9
10. 5. Testing & Debugging
During this phase, we check whether the code written in previous step is solving the
specified problem or not. That means we test the program whether it is solving the problem
for various input data values or not. We also test that whether it is providing the desired
output or not.
6. Maintenance
During this phase, the program is actively used by the users. If any enhancements
found in this phase, all the phases are to be repeated again to make the enhancements. That
means in this phase, the solution (program) is used by the end user. If the user encounters
any problem or wants any enhancement,then we need to repeat all the phases from the
starting, so that the encountered problem is solved or enhancement is added.
Dr.M.Sudharsan 10
11. Topic 3 : Introduction to Algorithms
Introduction to Algorithm
Muhammad ibn Musa al-Khwarizmi, mathematician
Algorithms have a long history and the word can be traced back to the 9th century. At this
time the Persian scientist, astronomer and mathematician Abdullah Muhammad bin Musa al-
Khwarizmi, often cited as “The father of Algebra”,
Dr.M.Sudharsan 11
14. Topic 4 :Characteristics
1. Each and every instruction should be precise and unambiguous i.e. each and every
instruction should be clear and should have only one meaning.
2. Each instruction should be performed in finite time.
3. One or more instructions should not be repeated infinitely. It means that the
algorithm must terminate ultimately.
4. After the instructions are executed, the user should get the required results.
5. It should accomplish only one thing.
6. It should lead to unique solution.
7. It should consist of finite number of steps
Dr.M.Sudharsan 14
16. Topic 5 :Categories of an
algorithm In order to solve a problem, some steps of instructions are performed in
chronological order. Sequential algorithms process elements sequentiallyThese
algorithms are usually used for processing lists, sets, arrays, etc. Examples of these
algorithms are bubble sort, selection sort, insertion sort, merge sort, quick sort, heap
sort, shell sort, radix sort
A parallel algorithm can execute several instructions at the same time on different
processing devices and combine them to produce a final output.
A hybrid algorithm is a combination of two or more algorithms that are designed
to provide better performance.
Dr.M.Sudharsan 16
17. Topic 6 :Writing an algorithm
Since the algorithm is language-independent, we write the steps to demonstrate the logic behind the solution to be used for solving a
problem. But before writing an algorithm, keep the following points in mind:
The algorithm should be clear and unambiguous.
There should be 0 or more well-defined inputs in an algorithm.
An algorithm must produce one or more well-defined outputs that are equivalent to the desired output. After a specific number
of steps, algorithms must ground to a halt.
Algorithms must stop or end after a finite number of steps.
In an algorithm, step-by-step instructions should be supplied, and they should be independent of any computer code.
Example 1: Write an algorithm to find the maximum of all the elements present in the array.
Follow the algorithm approach as below:
Step 1: Start the Program
Step 2: Declare a variable max with the value of the first element of the array.
Step 3: Compare max with other elements using loop.
Step 4: If max < array element value, change max to new max.
Step 5: If no element is left, return or print max otherwise goto step 3.
Step 6: End of Solution
Dr.M.Sudharsan 17
18. Topic 7 :Flow chart
• A flowchart is a picture of the separate steps of a process in sequential
order
• Flowcharts are nothing but the graphical representation of the data or
the algorithm for a better understanding of the code visually. It
displays step-by-step solutions to a problem, algorithm, or process. It
is a pictorial way of representing steps.
Dr.M.Sudharsan 18
19. What is FlowChart?
A flowchart is a type of diagram that represents a workflow or
process. A flowchart can also be defined as a diagrammatic
representation of an algorithm, a step-by-step approach to solving a
task.
Flowchart symbols
Different types of boxes are used to make flowcharts flowchart
Symbols.
Dr.M.Sudharsan 19
20. Unit 1: Programming Process
Developing a program, program development cycle; Introduction to
Algorithms, Characteristics, writing an algorithm; Flowchart, Symbols,
guidelines for preparing flowchart, benefits of flowcharts, limitations
of flowcharts; Pseudo code, Pseudo code guidelines, benefits of
pseudo code, limitations of pseudo code; Number System
conversion.
Dr.M.Sudharsan 20
23. Topic no 8 :Guidelines for preparing
flowchart
Understand the Process
Define the Start and End Points
Use Standard Symbols
Keep It Simple Use Proper Flow Arrows
Label Everything
Consistency
Use Decision Diamonds
Keep Lines Straight and Neat
Avoid Crossovers
Group Related Steps
Test Your Flowchart
Use Annotations
Dr.M.Sudharsan 23
24. Topic no 9 :Benefits of flowcharts
• Clarity and Understanding: Flowcharts provide a clear and visual representation
of complex processes or algorithms, making it easier for individuals to understand
how a system works, even if they are not familiar with the details.
• Simplified Communication: Flowcharts serve as a universal language that can be
understood by different stakeholders, including non-technical personnel,
management, and technical experts. They facilitate effective communication and
collaboration.
• Process Documentation: Flowcharts are valuable tools for documenting
processes and procedures within an organization. This documentation can be
used for training, auditing, and process improvement purposes.
• Problem-Solving: Flowcharts can be used as problem-solving tools to identify
bottlenecks, inefficiencies, or areas of improvement within a process. Analyzing a
flowchart can help identify where issues arise.
Dr.M.Sudharsan 24
25. • Standardization: Flowcharts can help standardize processes within an organization by
providing a clear and consistent representation of how tasks should be performed. This can
lead to better quality control.
• Decision Support: Decision points in a process can be represented using decision diamonds
in a flowchart. This helps individuals make informed decisions by following the logical paths
outlined in the chart.
• Project Planning: Flowcharts are useful for project planning and management. They can be
used to define project workflows, identify critical tasks, and allocate resources efficiently.
• Quality Assurance: Flowcharts can be employed as part of a quality assurance process to
ensure that processes are followed correctly and consistently, helping to maintain high-quality
standards.
• Process Visualization: For complex systems or projects, flowcharts can provide an at-a-
glance overview of the entire process, allowing individuals to quickly grasp the sequence of
steps involved.
• Collaboration and Feedback: Flowcharts can be easily shared and discussed among team
members, allowing for collaborative problem-solving and the incorporation of feedback.
• Continuous Improvement: Flowcharts can be updated and revised as processes evolve,
making them valuable tools for continuous improvement and process optimization.
Dr.M.Sudharsan 25
26. Topic no 10 : limitations of flowcharts
Simplicity and Abstraction: Flowcharts simplify complex processes
Difficulty with Large Processes: Flowcharts can become unwieldy and difficult to read when representing
large and complex processes.
Lack of Standardization: Although there are common symbols and conventions for flowcharts, there is no
universal standard.
Limited Decision Complexity: While flowcharts can represent simple decision points with ease
Limited for Algorithm Complexity: While flowcharts are useful for outlining simple algorithms
Maintenance Challenges: Updating or revising flowcharts as processes evolve can be time-consuming
Interconnected Processes: When processes are interconnected or interdependent, it can be challenging to
represent these relationships
Dr.M.Sudharsan 26
27. Topic no 11 : Pseudo code, Pseudo code guidelines,
benefits of pseudo code, limitations of pseudo code
• This pseudo code outlines the steps to find the maximum number in a list without specifying the actual code
in any particular programming language. Pseudo code is a useful tool for planning and designing algorithms
before you start coding in a specific language.
• Pseudo code is a way of representing the logic of a computer program or algorithm using plain language or a
simplified notation that is not tied to a specific programming language.
• This pseudo code describes the logic of calculating the factorial of a number without specifying the actual
programming language syntax. It provides a high-level overview of the algorithm's steps.
Dr.M.Sudharsan 27
28. Benefits/Advantages of Pseudocode:
Can be done easily on a word processor
Easily modified
Implements structured concepts well
Clarify algorithms in many cases.
Impose increased discipline on the process of documenting detailed design.
Provide additional level at which inspection can be performed.
Help to trap defects before they become code.
Increases product reliability.
May decreases overall costs.
It can be easily modified as compared to flowchart
Its implementation is very useful in structured design elements.
It can be written easily. • It can be read and understood easily
Dr.M.Sudharsan 28
29. Limitations/Disadvantages of Pseudocode:
It's not visual
Create an additional level of documentation to maintain.
Introduce error possibilities in translating to code.
May require tool to extract pseudocode and facilitate drawing flowcharts.
There is no accepted standard, so it varies widely from company to
company
We do not get a picture of the design.
There is no standardized style or format, so one pseudocode may be
different from another.
For a beginner, it is more difficult to follow the logic or write pseudocode
as compared to flowchart
Dr.M.Sudharsan 29
31. Pseudo Guidelines/ Rules for Pseudocode
1. Write only one statement per line
2. Capitalize initial keyword
3. Indent to show hierarchy
4. End multiline structures
5. Keep statements language independent
Dr.M.Sudharsan 31
32. 1. Write only one statement per line:
• Each statement in your pseudocode should express just one action for the computer.If the task list is properly drawn, then in
most cases each task will correspond to one line of pseudocode.
EX: TASK LIST:
Read name, hourly rate, hours worked, deduction rate
Perform calculations
gross = hourlyRate * hoursWorked
deduction = grossPay * deductionRate
Dr.M.Sudharsan 32
33. 2.Capitalize initial keyword
• In the example above, READ and WRITE are in caps. There are just a few keywords we will use
READ, WRITE, IF, ELSE, ENDIF, WHILE, ENDWHILE, REPEAT, UNTIL
Dr.M.Sudharsan 33
34. 3.Indent to show hierarchy
SEQUENCE: keep statements that are “stacked” in sequence all starting in the same column.
SELECTION: indent the statements that fall inside the selection structure, but not the keywords that form the selection
LOOPING: indent the statements that fall inside the loop, but not the keywords that form the loop
Ex
PSEUDOCODE:
READ name, hourlyRate, hoursWorked,deduction
grossPay = hourlyRate * hoursWorked
IF grossPay>= 100
deduction = grossPay * deductionRate
ELSE
deduction = 0
ENDIF
netPay = grossPay – deduction
WRITE name, grossPay, deduction, netPay
Dr.M.Sudharsan 34
35. 4. End multiline structures
• See how the IF/ELSE/ENDIF is constructed above. The ENDIF (or END whatever) always is in line with the
IF (or whatever starts the structure)
Dr.M.Sudharsan 35
36. 5. Keep statements language independent
• To write in whatever language you are most comfortable with. In the long run, you will save time! There may
be special features available in the language you plan to eventually write the program easily.
The pseudocode for this would be:
IF amount < 1000
interestRate = .06 // the “yes” or “true” action
ELSE
interestRate = .10 // the “no” or “false” action
ENDIF
Dr.M.Sudharsan 36
37. NUMBER SYSTEM
• NUMBER SYSTEM
• Number systems are the technique to represent numbers in the computer system architecture, every
value that you are saving or getting into/from computer memory has a defined number system.
I. Decimal – base 10
II. Binary – base 2
III. Octal- base 8
IV. Hexadecimal- base 16
Dr.M.Sudharsan 37
39. Number systems are fundamental to mathematics, computer science,
and various fields
Representation of Quantities: Number systems allow us to represent and work with quantities. They provide a structured way to
express quantities of objects, measurements, or values. For example, the decimal system (base-10) is commonly used for counting
and representing real-world quantities.
Mathematical Operations: Number systems are the foundation of mathematical operations such as addition, subtraction,
multiplication, and division. They provide a framework for performing calculations and solving mathematical problems.
Data Storage and Processing: In computer science, different number systems are used to represent and process data. For example,
binary (base-2) is used in digital computing to represent and manipulate data at the lowest level, as computers use binary digits
(bits) to store and process information.
Digital Electronics: Number systems play a critical role in digital electronics and circuit design. Binary and hexadecimal (base-16)
are commonly used to represent data in digital circuits, which are the building blocks of modern electronic devices of science and
engineering.
Dr.M.Sudharsan 39
40. A number system, also known as a numeral system or numeric system, is a mathematical notation or way of representing
numbers. Number systems provide a systematic way to express and manipulate quantities, values, and mathematical
concepts. There are several different number systems, each with its own base or radix, which determines the number of
unique symbols used to represent values.
Dr.M.Sudharsan 40
45. Conversions
Binary to decimal
Binary to octal
Binary to Hexadecimal
Decimal to Binary
Decimal to Octal
Decimal to Hexadecimal
Octal to Decimal
Octal to Binary
Octal to hexadecimal
Hexadecimal to binary
Hexadecimal to octal
Hexadecimal to decimal
Dr.M.Sudharsan 45