0% found this document useful (0 votes)
8 views42 pages

Problem Solving and Algorithms Guide

The document discusses problem analysis and solving in programming, emphasizing the decomposition of complex problems into simpler sub-problems. It introduces algorithms and flowcharts as methods to represent and solve problems, detailing control structures such as sequence, selection, and repetition. Additionally, it explains the concept of variables and how to assign values to them in programming.
Copyright
© All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PPTX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
8 views42 pages

Problem Solving and Algorithms Guide

The document discusses problem analysis and solving in programming, emphasizing the decomposition of complex problems into simpler sub-problems. It introduces algorithms and flowcharts as methods to represent and solve problems, detailing control structures such as sequence, selection, and repetition. Additionally, it explains the concept of variables and how to assign values to them in programming.
Copyright
© All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PPTX, PDF, TXT or read online on Scribd

Programming

Problem analyzing
 In day today daily life we face lot of
problems and we will learn how to solve
the problem.
 Examples
 How to make cup of tea
 How to make birthday cake
 How to make a fruit salad
 How to cook rice.
Programming
 How to wear shoes
 How to dress your school uniform
Problem solving
It is easy to find a solution for a problem by
decomposing complex problem into simple
Sub-problems
Programming
Programming
Programming
Programming
 Calculate the total price for each item of
invoice
Programming
 After decompose in to small sub problem
You can easily identify what are the input ,
process and output in analyzed problem.
Programming
 After you identify the Input , Process and
Output of a problem then you can solve the
problem using suitable method.
 Algorithm is such method you can use to
solve a problem.
Programming
Algorithm
 Algorithm is method which incudes all the
steps of solving a problem.

Flow Chart
 Flow charts is a graphical representation of
Algorithmic steps.
Programming
Format of Algorithm
Step [Link]
Step [Link]
Step [Link] Control Structures
Step [Link]
Step [Link]
Programming
Flowchart Symbols
Symbol Name Function
Oval Start and End

Parallelogram Input and Output

Rectangle Process
Programming
Flowchart Symbols
Symbol Name Function
Yes Diamond Selection(decision

making)
No

Arrow Data Flow


Programming
Format of flowchart
Start

Input

Process

OutPut

End
Programming
Control Structures
1)Sequence
2)Selection
3)Repetition
 Sequence
 Set of Actions can be taken out one after
other from top to bottom in a consecutive
order is called Sequence.
Programming
Example 1
Programming
Programming
Programming
Algorithm
Step 1 Start
Step 2 Finding different types of fruits
Step 3 Washing all the fruits
Step 5 Cutting fruits into small pieces
Step 6 Putting fruits into bowl
Step 7 Adding sugar and mix
Step 8 Serve the fruit salad In bowl
Step Stop
Programming
Flowchart
Programming
 Selection
 Selection decides which actions are
executed base on whether the given
condition is satisfied or not.
 There are two type of Selection
Programming
 Selection
 Selection decides which actions are
executed base on whether the given
condition is satisfied or not.
Example 1
Programming
Example 2
Programming
Example 3
Programming
 Repetition
 Example 1
1st Time 1)Take a till
2)Put Money
3)is till full
4)Put money
Programming
 Repetition
2rd Time 1)Take till
2)Put Money
3)is till full
4)Put money
Programming
 Repetition
3rd Time 1)Take a till
2)Put Money
3)is till full
4)Put money
Programming
 Repetition
100th Time 1)Take a till
2)Put Money
3)is till full
4)Put money
Programming
 Repetition
Programming
 Repetition
 Exsaple2
Programming
 Repetition
Programming
 Repetition
Programming
 Repetition
Executing of instruction(s) in an algorithm
repeatedly until the condition is satisfied.
Programming
 Repetition
Programming
 What is variable
Variable is used to store value in memory
temporarily
Example

A B C
Programming
 A glass is filled with Fanta
 C glass is filled with Potalo
 Task=Change C to A and A to C
1

A B C
Programming
 Put A into B

A B
Programming
 Put C to A

A C

A C
Programming
 Put B to C

B C

B C
Programming
 Assign Values to Variables
Rule
Variable is written left to the equal sign and
Value is written right to the equal sign
Example A=10

Variable Value
Programming
 Assign 10 to A
L R
 Assign value Right to Left
A=10
0
0 10

A A
Just created After Assign Value
Programming

C
Programming
B=10
10

C=A + B

20 + 10 10

C B A

You might also like