0% found this document useful (0 votes)
13 views11 pages

Unit 1

Uploaded by

amulyacs143
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)
13 views11 pages

Unit 1

Uploaded by

amulyacs143
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
You are on page 1/ 11

303105104 - Computational Thinking

for Structured Design-1


CHAPTER-1
FLOWCHART & ALGORITHMS
Flow Charts The Flowchart
(Dictionary) A schematic representation of a sequence of operations, as in a manufacturing
process or computer program.
(Technical) A graphical representation of the sequence of operations in an information
system or program.
A Flowchart
shows logic of an algorithm
emphasizes individual steps and their interconnections
e.g. control flow from one action to the next
Flowchart Symbols

Symbols
Basic Example 1: Add 2 Numbers

START

Read a,b

c =/ a+b

Read a,b

STOP
Basic Example 2: Check a Number is Positive or Negative
START

Read
a

N IS Y
a>0

Print Print
“Negative” “Positive”

STOP
Algorithms ALGORITHMS AND FLOWCHARTS
A typical programming task can be divided into two phases:
Problem solving phase
produce an ordered sequence of steps that describe solution of problem
this sequence of steps is called an algorithm
Implementation phase
implement the program in some programming language
Pseudocode is an artificial and informal language that helps programmers
develop algorithms. Pseudocode is very similar to everyday English.
Basic Example 1: AddALGORITHMS
2 Numbers AND FLOWCHARTS
STEP1: Take Input of 2 Numbers a & b.
STEP2: Calculate c = a+b.
STEP3: Print c.
STEP4: STOP
Basic Example 2: Check a Number isAND
ALGORITHMS Positive or Negative
FLOWCHARTS
STEP1: Take Input of a Number a.
STEP2: Check Whether a > 0? GOTO STEP5.
STEP3: Print “Number is Negative”.
STEP4: STOP
STEP5: Print “Number is Positive”.
STEP6: STOP
Examples for Practice during Regular Theory Sessions
The Flowchart
Draw a Flowchart and Write Algorithms for the Following:

1. Find the area of Circle, Square, Rectangle and Triangle.


2. Find the Maximum Number out of 2 Numbers.
3. Check a Number is Even or Odd.
4. Find the Minimum Number out of 3 Numbers.
5. Find the Maximum and Minimum Numbers (in Same Output) out of 3 Numbers
6. Calculate Total Marks, Percentage and based on Percentage declare Result Class as Distinction, First
Class, Second Class, Pass Class or Fail. Decide Range of Percentage accordingly for Result Class.
www.paruluniversity.ac.in

You might also like