0% found this document useful (0 votes)
20 views

Python

This document discusses problem solving and basics of flowcharts. It contains information about the distribution of marks and periods for different units in Computer Science. It describes the general steps of problem solving as identifying the problem, analyzing it, developing solutions, implementing a solution and measuring results. It provides examples of problem solving for coding problems. It also introduces basic flowchart symbols and shows how flowcharts can be used to represent solutions to problems like finding discounted price, simple interest, average of numbers and more. Pseudocode is also introduced as a way to represent algorithms.

Uploaded by

cubie 1098
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
20 views

Python

This document discusses problem solving and basics of flowcharts. It contains information about the distribution of marks and periods for different units in Computer Science. It describes the general steps of problem solving as identifying the problem, analyzing it, developing solutions, implementing a solution and measuring results. It provides examples of problem solving for coding problems. It also introduces basic flowchart symbols and shows how flowcharts can be used to represent solutions to problems like finding discounted price, simple interest, average of numbers and more. Pseudocode is also introduced as a way to represent algorithms.

Uploaded by

cubie 1098
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 15

3

© Department of Computer Science, DPS R.K.Puram, New Delhi


Computer Science 083
Problem Solving and Basics of Flowcharts
Distribution of Marks and Periods 2

© Department of Computer Science, DPS R.K.Puram, New Delhi


Unit Unit Name Marks Periods
No. Theory Practical
1. Computer Systems and Organisation 10 10 5
2. Computational Thinking and Programming 45 50 35
3. Society, Law and Ethics - 1 15 20 --
Total 70 80 40
Introduction to problem solving: Steps for problem solving 3

Problem solving is the act/process of identifying the problem, analysing the


problem, describing the problem, looking for the root causes of the problem,

© Department of Computer Science, DPS R.K.Puram, New Delhi


developing alternate solutions, implementing the solution, measuring the results.

PROBLEM SOLVING - GENERAL


PROBLEM SOLVING - CODING RELATED
Step 1: Identify the Problem
Step 2: Analyze the Problem 1. Identifying the problem
Step 3: Describe the Problem 2. Analysing the problem,
Step 4: Look for Root Causes 3. Developing an algorithm,
Step 5: Develop Alternate Solutions 4. Coding in Programming Language
Step 6: Implement the Solution 5. Testing and Debugging
Step 7: Measure the Results
Problem solving - Pseudocode 4

1. Assign A=100, B=80, C=90

© Department of Computer Science, DPS R.K.Puram, New Delhi


2. Calculate C=(A+B+C)/3
3. Print C

1. Input Length, Breadth


2. Calculate Area = Length * Breadth
3. Print Area

1. Input Amt1, Amt2


2. If Amt1 > Amt2
Print Amt1
Else
Print Amt2
Using flowcharts 5

BASIC FLOWCHART SYMBOLS START/STOP

© Department of Computer Science, DPS R.K.Puram, New Delhi


PROCESS/ASSIGNMENT

INPUT/OUTPUT or I/O

DECISION MAKING

FLOW OF CONTROL
PROBLEM SOLVING WITH SOLUTIONS IN STEPS 6

A Flowchart is a type of DIAGRAMATIC representation of a WORKFLOW or a

© Department of Computer Science, DPS R.K.Puram, New Delhi


PROCESS. A flowchart can also be defined as a diagrammatic representation of
an algorithm, a step-by-step approach to solve a task/problem.

Pseudocode is an ARTIFICIAL and INFORMAL language that helps programmers


develop algorithms. Pseudocode is a "text-based" step by step detail
(algorithmic) design of a solution. Pseudocode does not follow syntax of any
specific programming language.
Decomposition of problem using flowcharts symbols 7

BASIC START START/STOP

© Department of Computer Science, DPS R.K.Puram, New Delhi


FLOWCHART
SYMBOLS A=1
WITH PROCESS/ASSIGNMENT
B=10*A
SAMPLE
CONTENT INPUT
INPUT/OUTPUT or I/O
IN/WITH P,Q
EACH
SYMBOL IS
A<P DECISION MAKING
?
YES FLOW OF CONTROL
Using flowchart to find discounted price 8

START
FLOWCHART P=6000

© Department of Computer Science, DPS R.K.Puram, New Delhi


REQUIRES PROPER
P=6000 D=20
POSITIONING OF
THESE SYMBOLS D=20 DP=P-P*D/100
WITH
print("DP=",DP)
APPROPRIATE
CONTENT & DP=P-P*D/100
SEQUENCE
CONNECTED WITH
DIRECTION
OUTPUT
ARROWS TO SOLVE
DP
A TASK/PROBLEM

STOP
Using flowchart to find Simple Interest 9

START
FLOWCHART P=4000

© Department of Computer Science, DPS R.K.Puram, New Delhi


REQUIRES PROPER
P=4000 R=10
POSITIONING OF
THESE SYMBOLS R=10 T=3
WITH T=3
SI=P*R*T/100
APPROPRIATE
CONTENT & SI = P*R*T/100 print("SI=",SI)
SEQUENCE
CONNECTED WITH
DIRECTION
OUTPUT
ARROWS TO SOLVE
SI
A TASK/PROBLEM

STOP
Using flowchart to find Average of 3 Numbers 10

START
FLOWCHART A=90

© Department of Computer Science, DPS R.K.Puram, New Delhi


REQUIRES PROPER B=70
POSITIONING OF
A=90
B=70 C=80
THESE SYMBOLS AVG=(A+B+C)/3
WITH C=80
print("AVG=",AVG)
APPROPRIATE
CONTENT & AVG=(A+B+C)/3
SEQUENCE
CONNECTED WITH
DIRECTION
OUTPUT
ARROWS TO SOLVE
AVG
A TASK/PROBLEM

STOP
Using flowchart to find area of a rectangle 11

START
FLOWCHART L=60

© Department of Computer Science, DPS R.K.Puram, New Delhi


REQUIRES PROPER
L=60 B=40
POSITIONING OF
THESE SYMBOLS B=40 AREA=L*B
WITH
print("AREA=",AREA)
APPROPRIATE
CONTENT & AREA=L*B
SEQUENCE
CONNECTED WITH
DIRECTION
OUTPUT
ARROWS TO SOLVE
AREA
A TASK/PROBLEM

STOP
Using flowchart to find bigger number 12

START P=90

© Department of Computer Science, DPS R.K.Puram, New Delhi


Q=70
if P<Q:
P=90 print(Q,"BIGGER")
Q=70 else:
print(P,"BIGGER/EQUAL")

NO IS YES
OUTPUT OUTPUT
P<Q
P,"BIG/EQ" Q,"BIGGER"
?

STOP
Using flowchart to find Right Voting Age 13

START Age=19

© Department of Computer Science, DPS R.K.Puram, New Delhi


if Age>=18:
print("CAN VOTE")
else:
Age=19
print("CANT VOTE")

NO IS YES
OUTPUT OUTPUT
Age>=
"CANT VOTE" "CAN VOTE"
18?

STOP
Using flowchart to check correct city name 14

START City=input("CITY")

© Department of Computer Science, DPS R.K.Puram, New Delhi


if City=="DELHI":
print("CAPITAL")
INPUT else:
CITY print("NOT CAPITAL")

YES NO
OUTPUT IS
OUTPUT
City=
"CAPITAL" "NOT CAPITAL"
"DELHI"?

STOP
15

© Department of Computer Science, DPS R.K.Puram, New Delhi


Thank you!
Department of Computer Science
Delhi Public School R.K.Puram New Delhi

You might also like