Computer Science
As Per Latest
CBSE
Syllabus
Class XI
Introduction to Problem-solving
Computer Systems and Organisation :
Problem-solving is the process of identifying a problem, analyzing it, designing a solution, and
implementing that solution using programming.
Steps of Problem-solving in Programming
1. Problem Analysis: Understand what is being asked. Identify the inputs, expected outputs, and
constraints.
2. Algorithm Development: Write a step-by-step plan or solution strategy. Should be
unambiguous, finite, and effective.
3. Coding: Translate the algorithm into a program using a programming language (e.g., Python).
4. Testing: Run the program with various inputs to ensure it works correctly.
5. Debugging: Identify and fix errors (bugs) in the code to get the correct output.
Algorithm :
An algorithm is a finite sequence of well-defined instructions for solving a problem.
Characteristics of a Good Algorithm:
Step 1: Start
•Input: Clearly defined inputs.
Step 2: Read A, B
•Output: Expected output for given input.
Step 3: If A > B, then
•Definiteness: Each step must be clearly defined.
Display A is greater
•Finiteness: Must end after a finite number of steps.
Else
•Effectiveness: Every step must be practically feasible.
Display B is greater
Step 4: Stop
Example Algorithm: Find the larger
of two numbers A and B
Flowchart :
A Flowchart is a diagrammatic representation of an algorithm that uses standardized symbols to show
the sequence of steps involved in solving a problem.
Symbols Used:
Flowchart to add two numbers
Flowchart Examplw:
Flowchart to check Odd or Even Number
Flowchart Example:
Flowchart to find the largest among three numbers
Components of a Computer System:
Pseudocode:
Start
•Written in plain English, no syntax rules.
Input A, B
•Focuses on the logic of the program.
If A > B
Print "A is greater"
Decomposition
Else
Decomposition means breaking a large problem into smaller parts,
Print "B is greater"
making it easier to design, implement, and maintain.
Stop
Example: Create a Student Management System Decompose into:
Pseudocode Example
•Add student details
•View student records
•Update data
•Delete data