Problem-solving in computers is a systematic approach to finding solutions using logical steps. It involves breaking a complex problem into smaller, manageable steps that can be executed using a computer program. The two fundamental tools used for problem-solving in computing are Algorithms and Flowcharts.
Algorithm
Characteristics of a Good Algorithm
Well-defined Input and Output – The algorithm should clearly specify input and the expected output.
Finite Steps – It must terminate after a limited number of steps.
Unambiguous – Each step must be clearly defined and lead to only one interpretation.
Effective and Feasible – It should be practically executable within a reasonable time and resources.
Generality – It should be applicable to a variety of problems of the same type.
Example of an Algorithm
Start
Read two numbers A and B
Compute sum = A + B
Display sum
Stop
Flowchart
A flowchart is a visual representation of an algorithm using symbols to depict different types of actions. It helps in understanding the flow of a program in an easy and structured way.
Basic Flowchart Symbols
Oval (Terminator): Represents the start or end of a flowchart.
Parallelogram (Input/Output): Represents input or output operations.
Rectangle (Process): Represents processing steps such as calculations.
Diamond (Decision): Represents decision-making with conditions (Yes/No).
Arrows: Indicate the flow of execution.
Example Flowchart for Adding Two Numbers
Start (Oval)
Input A, B (Parallelogram)
Sum = A + B (Rectangle)
Display Sum (Parallelogram)
Stop (Oval)