SlideShare a Scribd company logo
1 of 33
USING FLOWCHARTS
AND PSEUDOCODE
STATEMENTS
Algorithm
 A typical programming task can be divided into
two phases:
 Problem solving phase
 Implementation phase
 Algorithm is a written series of logical instructions
which accomplish solution to a problem.
 Pseudo code is an artificial and informal language
that helps to develop algorithms which is similar to
everyday English
Flowchart
 Flowchart shows graphical representation of a
sequence of steps involved in a program
(algorithm)
 The two major types of flowchart:
 System flowchart – depicts the entire data flow from
one program to another throughout a system. It
provides a logical diagram of how the system
operates.
 Program flowchart – depicts the series of operations
that the computer follows to generate the desired
information. It represents in detail, the various steps to
be performed within the system for transforming the
Flowchart Symbols
Name Symbol Use in Flowchart
Terminal Defines the starting and ending point of flowchart
Initialization
The preparation/initialization of memory space for data
processing
Input/Output
The inputting of data for processing, and the printing out
of processed data
Process
Manipulation of data (assignments and mathematical
computations)
Predefined
Process
Manipulation of data (assignments and mathematical
computations) in function/subroutine form
Decision
Process conditions using relational operators. Used for
trapping and filtering data
Flow Lines
Defines the logical sequence of the program. It points to
the next symbol to be performed
On-page
Connector
Connects the flowchart to avoid spaghetti connection on
the same page
Off-page
Connector
Connects the flowchart to avoid spaghetti connection on
different page
Basic Control Structure
 Used to organize the flow of control in an
algorithm
 Also called single entry/single exit structure,
there are three basic structure:
 Sequence – the process is execute from one to
another in a straight forward manner
Entry Exit
Basic Control Structure
 Selection – a choice is provided between two
alternatives
 The condition to be tested
 Process/statement to be performed if the condition is
satisfied
 Process/statement to be performed if the condition is
satisfied
True
False
Exit
Entry
Basic Control Structure
 Iteration/Repetitive or loop control – provides a
means of repeating part of an instruction without
rewriting that part of an instruction
 Body of the loop
 Loop-exit condition
Entry
Exit
Example No. 1
 Pseudo code:
1. Print “Enter your name”
2. Input a name
3. Print “Hello” and the name inputted
 Algorithm:
1. Print “Enter your name”
2. Input Name
3. Print “Hello”, Name
Example No. 1
Flowchart:
Start
Name
Print (“Enter
your name”)
Input Name
Print (“Hello”),
Name
Stop
Sample Output:
Enter your name
Shein
Hello Shein
Example No. 2
 Pseudo code:
1. Print “The program will add 2 numbers:”
2. Print “Input the first number:”
3. Input the first number
4. Print “Input the second number:”
5. Input the second number
6. Calculate the sum of the two numbers
7. Print “The sum is”, and the sum of the two
numbers
Example No. 2
 Algorithm:
1. Print “The program will add 2 numbers:”
2. Print “Input the first number:”
3. Input fst
4. Print “Input the second number:”
5. Input sec
6. Sum = fst + sec
7. Print “The sum is”, Sum
Example No. 2
Flowchart:
Start
fst, sec, Sum
Print (“The program will
add 2 numbers:”)
Print “Input the first
number:”
Input fst
1
1
Print (“Input the second
number:”)
Input sec
Print (“The sum
is”, Sum)
Sum = fst + sec
Stop
How many
hours did
you work?
START
Print(“How
many hours did
you work?”)
Input Hours
Print(“How
much do you
get paid per
hour?”)
Input PayRate
Print (“Gross
Pay”,
GrossPay)
END
Variable Contents:
Hours: ?
Pay Rate: ?
Gross Pay: ?
Output
Operation
Stepping through the
Flowchart
GrossPay=Hours
* PayRate
How many
hours did
you work?
40
START
Print(“How
many hours did
you work?”)
Input Hours
Print(“How
much do you
get paid per
hour?”)
Input PayRate
Print (“Gross
Pay”,
GrossPay)
END
Variable Contents:
Hours: 40
Pay Rate: ?
Gross Pay: ?
Input
Operation
(User types
40)
GrossPay=Hours
* PayRate
Stepping through the
Flowchart
How much
do you get
paid per
hour?
START
Print(“How
many hours did
you work?”)
Input Hours
Print(“How
much do you
get paid per
hour?”)
Input PayRate
Print (“Gross
Pay”,
GrossPay)
END
Variable Contents:
Hours: 40
Pay Rate: ?
Gross Pay: ?
Output
Operation
GrossPay=Hours
* PayRate
Stepping through the
Flowchart
How much
do you get
paid per
hour? 20
START
Print(“How
many hours did
you work?”)
Input Hours
Print(“How
much do you
get paid per
hour?”)
Input PayRate
Print (“Gross
Pay”,
GrossPay)
END
Variable Contents:
Hours: 40
Pay Rate: 20
Gross Pay: ?
Input
Operation
(User types
20)
GrossPay=Hours
* PayRate
Stepping through the
Flowchart
How much
do you get
paid per
hour? 20
START
Print(“How
many hours did
you work?”)
Input Hours
Print(“How
much do you
get paid per
hour?”)
Input PayRate
GrossPay=Hours
* PayRate
Print (“Gross
Pay”,
GrossPay)
END
Variable Contents:
Hours: 40
PayRate: 20
GrossPay: 800
Process: The
product of 40
times 20 is
stored in
Gross Pay
Stepping through the
Flowchart
START
Print(“How
many hours did
you work?”)
Input Hours
Print(“How
much do you
get paid per
hour?”)
Input PayRate
Print (“Gross
Pay”,
GrossPay)
END
Variable Contents:
Hours: 40
Pay Rate: 20
Gross Pay: 800
Output
Operation
Gross pay is
800
GrossPay=Hours
* PayRate
Stepping through the
Flowchart
Example No.3
1. Create a flowchart that
computes the product and
the quotient of two numbers.
Start
n1,n2,
prod,quo
Print (“ Enter
two numbers”)
prod=n1* n2
quo=n1/ n2
1
1
Print (“ The Product of
two numbers :”, prod)
Print (“ The Quotient of two
numbers :”, quo)
Stop
Example No.3
Input n1, n2
Seatwork:
1. Create a flowchart that will
convert inches to centimeter.
Wherein, 1 inch = 2.54cm.
Start
inch, cen
Print (“ Enter
Inch(es)”)
cen=inch* 2.54
Print (“ Converted Inche(s)”, cen)
Stop
Input inch
Additional exercises:
Add 10 and 20
Algorithm (in simple English)
 Initialize sum = 0 (PROCESS)
 Enter the numbers (I/O)
 Add them and store the result in sum
(PROCESS)
 Print sum (I/O)
 Flowchart
Find the sum of 5 numbers
Algorithm (in simple English)
1. Initialize sum = 0 and count =
0 (PROCESS)
2. Enter n (I/O)
3. Find sum + n and assign it to sum and then
increment count by 1 (PROCESS)
4. Is count < 5 (DECISION)
5. if YES go to step 2
else
Print sum (I/O)
Print Hello World 10 times
Algorithm (in simple English
1. Initialize count = 0 (PROCESS)
2. Print Hello World (I/O)
3. Increment count by 1 (PROCESS)
4. Is count < 10 (DECISION)
5. if YES go to step 2
else Stop
Draw a flowchart to log in to facebook
account
Algorithm (in simple English)
1. Enter www.facebook.com in your
browser. (I/O)
2. facebook Home page loads (PROCESS)
3. Enter your Email ID and Password (I/O)
4. Is Email ID and Password Valid (DECISION)
if NO then
Log in error (PROCESS)
go to step 3
else
Find the sum of the numbers in each set.
You are given hundred numbers divided in ten
sets in the following order.
Set 1: 1-10
Set 2: 11-20
Set 3: 21-30
…
Set 10: 91-100
Algorithm in simple English
Initialize count = 1 and i = 1 (PROCESS)
Check if i is less than or equal to 10 (DECISION)
if YES then perform step 3
else STOP
Set sum = 0 and j = 1 (PROCESS)
Check if j is less than or equal to 10 (DECISION)
if YES then perform step 5
else perform step 9
Add count to sum
sum = sum + count (PROCESS)
Increment count by 1
count = count + 1 (PROCESS)
Increment j by 1
j = j + 1 (PROCESS)
Go to Step 4
Print sum (I/O)
Increment i by 1
i = i + 1 (PROCESS)
Go to Step 2
Psuedocode1, algorithm1, Flowchart1.pptx

More Related Content

Similar to Psuedocode1, algorithm1, Flowchart1.pptx

algorithms and flow chart overview.pdf
algorithms and flow chart overview.pdfalgorithms and flow chart overview.pdf
algorithms and flow chart overview.pdfAmanPratik11
 
Algorithm and flowchart
Algorithm and flowchartAlgorithm and flowchart
Algorithm and flowchartSachin Goyani
 
Algorithms and Flowcharts
Algorithms and FlowchartsAlgorithms and Flowcharts
Algorithms and FlowchartsDeva Singh
 
ALGORITHM PPT GUIDE.pdf
ALGORITHM PPT GUIDE.pdfALGORITHM PPT GUIDE.pdf
ALGORITHM PPT GUIDE.pdfmeychu1
 
Csci101 lect03 algorithms_i
Csci101 lect03 algorithms_iCsci101 lect03 algorithms_i
Csci101 lect03 algorithms_iElsayed Hemayed
 
Python Training in Chandigarh(Mohali)
Python Training in Chandigarh(Mohali)Python Training in Chandigarh(Mohali)
Python Training in Chandigarh(Mohali)ExcellenceAcadmy
 
Python Training Course in Chandigarh(Mohali)
Python Training Course in Chandigarh(Mohali)Python Training Course in Chandigarh(Mohali)
Python Training Course in Chandigarh(Mohali)ExcellenceAcadmy
 
Debugger & Profiler in NetBeans
Debugger & Profiler in NetBeansDebugger & Profiler in NetBeans
Debugger & Profiler in NetBeansHuu Bang Le Phan
 
Pengenalan kepada pengaturcaraan berstruktur
Pengenalan kepada pengaturcaraan berstrukturPengenalan kepada pengaturcaraan berstruktur
Pengenalan kepada pengaturcaraan berstrukturUnit Kediaman Luar Kampus
 
Unit 1-problem solving with algorithm
Unit 1-problem solving with algorithmUnit 1-problem solving with algorithm
Unit 1-problem solving with algorithmrajkumar1631010038
 
Basic computer-programming-2
Basic computer-programming-2Basic computer-programming-2
Basic computer-programming-2lemonmichelangelo
 

Similar to Psuedocode1, algorithm1, Flowchart1.pptx (20)

algorithms and flow chart overview.pdf
algorithms and flow chart overview.pdfalgorithms and flow chart overview.pdf
algorithms and flow chart overview.pdf
 
Algorithm and flowchart
Algorithm and flowchartAlgorithm and flowchart
Algorithm and flowchart
 
Ch5(loops)
Ch5(loops)Ch5(loops)
Ch5(loops)
 
Foundations of Programming Part I
Foundations of Programming Part IFoundations of Programming Part I
Foundations of Programming Part I
 
Algorithms and Flowcharts
Algorithms and FlowchartsAlgorithms and Flowcharts
Algorithms and Flowcharts
 
Practical 01 (detailed)
Practical 01 (detailed)Practical 01 (detailed)
Practical 01 (detailed)
 
Algorithms and Flowchart.ppt
Algorithms and Flowchart.pptAlgorithms and Flowchart.ppt
Algorithms and Flowchart.ppt
 
3 algorithm-and-flowchart
3 algorithm-and-flowchart3 algorithm-and-flowchart
3 algorithm-and-flowchart
 
lecture 2.pptx
lecture 2.pptxlecture 2.pptx
lecture 2.pptx
 
ALGORITHM PPT GUIDE.pdf
ALGORITHM PPT GUIDE.pdfALGORITHM PPT GUIDE.pdf
ALGORITHM PPT GUIDE.pdf
 
Csci101 lect03 algorithms_i
Csci101 lect03 algorithms_iCsci101 lect03 algorithms_i
Csci101 lect03 algorithms_i
 
Algorithm.pdf
Algorithm.pdfAlgorithm.pdf
Algorithm.pdf
 
Programming Fundamentals
Programming FundamentalsProgramming Fundamentals
Programming Fundamentals
 
UNIT 1.pptx
UNIT 1.pptxUNIT 1.pptx
UNIT 1.pptx
 
Python Training in Chandigarh(Mohali)
Python Training in Chandigarh(Mohali)Python Training in Chandigarh(Mohali)
Python Training in Chandigarh(Mohali)
 
Python Training Course in Chandigarh(Mohali)
Python Training Course in Chandigarh(Mohali)Python Training Course in Chandigarh(Mohali)
Python Training Course in Chandigarh(Mohali)
 
Debugger & Profiler in NetBeans
Debugger & Profiler in NetBeansDebugger & Profiler in NetBeans
Debugger & Profiler in NetBeans
 
Pengenalan kepada pengaturcaraan berstruktur
Pengenalan kepada pengaturcaraan berstrukturPengenalan kepada pengaturcaraan berstruktur
Pengenalan kepada pengaturcaraan berstruktur
 
Unit 1-problem solving with algorithm
Unit 1-problem solving with algorithmUnit 1-problem solving with algorithm
Unit 1-problem solving with algorithm
 
Basic computer-programming-2
Basic computer-programming-2Basic computer-programming-2
Basic computer-programming-2
 

More from MattFlordeliza1

JDBC OVERVIEW uses from the subject of EDP.pptx
JDBC OVERVIEW uses from the subject of EDP.pptxJDBC OVERVIEW uses from the subject of EDP.pptx
JDBC OVERVIEW uses from the subject of EDP.pptxMattFlordeliza1
 
ACtionlistener in java use in discussion.pptx
ACtionlistener in java use in discussion.pptxACtionlistener in java use in discussion.pptx
ACtionlistener in java use in discussion.pptxMattFlordeliza1
 
PLF-Lesson tsu lecture time 2 units-2.pptx
PLF-Lesson tsu lecture time 2 units-2.pptxPLF-Lesson tsu lecture time 2 units-2.pptx
PLF-Lesson tsu lecture time 2 units-2.pptxMattFlordeliza1
 
PLF-Lesson-5 programming in TSU lec.pptx
PLF-Lesson-5 programming in TSU lec.pptxPLF-Lesson-5 programming in TSU lec.pptx
PLF-Lesson-5 programming in TSU lec.pptxMattFlordeliza1
 

More from MattFlordeliza1 (6)

JDBC OVERVIEW uses from the subject of EDP.pptx
JDBC OVERVIEW uses from the subject of EDP.pptxJDBC OVERVIEW uses from the subject of EDP.pptx
JDBC OVERVIEW uses from the subject of EDP.pptx
 
ACtionlistener in java use in discussion.pptx
ACtionlistener in java use in discussion.pptxACtionlistener in java use in discussion.pptx
ACtionlistener in java use in discussion.pptx
 
PLF-Lesson tsu lecture time 2 units-2.pptx
PLF-Lesson tsu lecture time 2 units-2.pptxPLF-Lesson tsu lecture time 2 units-2.pptx
PLF-Lesson tsu lecture time 2 units-2.pptx
 
PLF-Lesson-5 programming in TSU lec.pptx
PLF-Lesson-5 programming in TSU lec.pptxPLF-Lesson-5 programming in TSU lec.pptx
PLF-Lesson-5 programming in TSU lec.pptx
 
www module 1.pptx
www module 1.pptxwww module 1.pptx
www module 1.pptx
 
QUEUE.pptx
QUEUE.pptxQUEUE.pptx
QUEUE.pptx
 

Recently uploaded

Pigging Solutions in Pet Food Manufacturing
Pigging Solutions in Pet Food ManufacturingPigging Solutions in Pet Food Manufacturing
Pigging Solutions in Pet Food ManufacturingPigging Solutions
 
Integration and Automation in Practice: CI/CD in Mule Integration and Automat...
Integration and Automation in Practice: CI/CD in Mule Integration and Automat...Integration and Automation in Practice: CI/CD in Mule Integration and Automat...
Integration and Automation in Practice: CI/CD in Mule Integration and Automat...Patryk Bandurski
 
SQL Database Design For Developers at php[tek] 2024
SQL Database Design For Developers at php[tek] 2024SQL Database Design For Developers at php[tek] 2024
SQL Database Design For Developers at php[tek] 2024Scott Keck-Warren
 
Kotlin Multiplatform & Compose Multiplatform - Starter kit for pragmatics
Kotlin Multiplatform & Compose Multiplatform - Starter kit for pragmaticsKotlin Multiplatform & Compose Multiplatform - Starter kit for pragmatics
Kotlin Multiplatform & Compose Multiplatform - Starter kit for pragmaticsAndrey Dotsenko
 
CloudStudio User manual (basic edition):
CloudStudio User manual (basic edition):CloudStudio User manual (basic edition):
CloudStudio User manual (basic edition):comworks
 
Snow Chain-Integrated Tire for a Safe Drive on Winter Roads
Snow Chain-Integrated Tire for a Safe Drive on Winter RoadsSnow Chain-Integrated Tire for a Safe Drive on Winter Roads
Snow Chain-Integrated Tire for a Safe Drive on Winter RoadsHyundai Motor Group
 
APIForce Zurich 5 April Automation LPDG
APIForce Zurich 5 April  Automation LPDGAPIForce Zurich 5 April  Automation LPDG
APIForce Zurich 5 April Automation LPDGMarianaLemus7
 
Unblocking The Main Thread Solving ANRs and Frozen Frames
Unblocking The Main Thread Solving ANRs and Frozen FramesUnblocking The Main Thread Solving ANRs and Frozen Frames
Unblocking The Main Thread Solving ANRs and Frozen FramesSinan KOZAK
 
Unlocking the Potential of the Cloud for IBM Power Systems
Unlocking the Potential of the Cloud for IBM Power SystemsUnlocking the Potential of the Cloud for IBM Power Systems
Unlocking the Potential of the Cloud for IBM Power SystemsPrecisely
 
Kotlin Multiplatform & Compose Multiplatform - Starter kit for pragmatics
Kotlin Multiplatform & Compose Multiplatform - Starter kit for pragmaticsKotlin Multiplatform & Compose Multiplatform - Starter kit for pragmatics
Kotlin Multiplatform & Compose Multiplatform - Starter kit for pragmaticscarlostorres15106
 
Key Features Of Token Development (1).pptx
Key  Features Of Token  Development (1).pptxKey  Features Of Token  Development (1).pptx
Key Features Of Token Development (1).pptxLBM Solutions
 
Streamlining Python Development: A Guide to a Modern Project Setup
Streamlining Python Development: A Guide to a Modern Project SetupStreamlining Python Development: A Guide to a Modern Project Setup
Streamlining Python Development: A Guide to a Modern Project SetupFlorian Wilhelm
 
Designing IA for AI - Information Architecture Conference 2024
Designing IA for AI - Information Architecture Conference 2024Designing IA for AI - Information Architecture Conference 2024
Designing IA for AI - Information Architecture Conference 2024Enterprise Knowledge
 
Unleash Your Potential - Namagunga Girls Coding Club
Unleash Your Potential - Namagunga Girls Coding ClubUnleash Your Potential - Namagunga Girls Coding Club
Unleash Your Potential - Namagunga Girls Coding ClubKalema Edgar
 
Build your next Gen AI Breakthrough - April 2024
Build your next Gen AI Breakthrough - April 2024Build your next Gen AI Breakthrough - April 2024
Build your next Gen AI Breakthrough - April 2024Neo4j
 
My INSURER PTE LTD - Insurtech Innovation Award 2024
My INSURER PTE LTD - Insurtech Innovation Award 2024My INSURER PTE LTD - Insurtech Innovation Award 2024
My INSURER PTE LTD - Insurtech Innovation Award 2024The Digital Insurer
 
AI as an Interface for Commercial Buildings
AI as an Interface for Commercial BuildingsAI as an Interface for Commercial Buildings
AI as an Interface for Commercial BuildingsMemoori
 
Install Stable Diffusion in windows machine
Install Stable Diffusion in windows machineInstall Stable Diffusion in windows machine
Install Stable Diffusion in windows machinePadma Pradeep
 

Recently uploaded (20)

Pigging Solutions in Pet Food Manufacturing
Pigging Solutions in Pet Food ManufacturingPigging Solutions in Pet Food Manufacturing
Pigging Solutions in Pet Food Manufacturing
 
Integration and Automation in Practice: CI/CD in Mule Integration and Automat...
Integration and Automation in Practice: CI/CD in Mule Integration and Automat...Integration and Automation in Practice: CI/CD in Mule Integration and Automat...
Integration and Automation in Practice: CI/CD in Mule Integration and Automat...
 
SQL Database Design For Developers at php[tek] 2024
SQL Database Design For Developers at php[tek] 2024SQL Database Design For Developers at php[tek] 2024
SQL Database Design For Developers at php[tek] 2024
 
Kotlin Multiplatform & Compose Multiplatform - Starter kit for pragmatics
Kotlin Multiplatform & Compose Multiplatform - Starter kit for pragmaticsKotlin Multiplatform & Compose Multiplatform - Starter kit for pragmatics
Kotlin Multiplatform & Compose Multiplatform - Starter kit for pragmatics
 
CloudStudio User manual (basic edition):
CloudStudio User manual (basic edition):CloudStudio User manual (basic edition):
CloudStudio User manual (basic edition):
 
E-Vehicle_Hacking_by_Parul Sharma_null_owasp.pptx
E-Vehicle_Hacking_by_Parul Sharma_null_owasp.pptxE-Vehicle_Hacking_by_Parul Sharma_null_owasp.pptx
E-Vehicle_Hacking_by_Parul Sharma_null_owasp.pptx
 
Snow Chain-Integrated Tire for a Safe Drive on Winter Roads
Snow Chain-Integrated Tire for a Safe Drive on Winter RoadsSnow Chain-Integrated Tire for a Safe Drive on Winter Roads
Snow Chain-Integrated Tire for a Safe Drive on Winter Roads
 
APIForce Zurich 5 April Automation LPDG
APIForce Zurich 5 April  Automation LPDGAPIForce Zurich 5 April  Automation LPDG
APIForce Zurich 5 April Automation LPDG
 
Unblocking The Main Thread Solving ANRs and Frozen Frames
Unblocking The Main Thread Solving ANRs and Frozen FramesUnblocking The Main Thread Solving ANRs and Frozen Frames
Unblocking The Main Thread Solving ANRs and Frozen Frames
 
Unlocking the Potential of the Cloud for IBM Power Systems
Unlocking the Potential of the Cloud for IBM Power SystemsUnlocking the Potential of the Cloud for IBM Power Systems
Unlocking the Potential of the Cloud for IBM Power Systems
 
Kotlin Multiplatform & Compose Multiplatform - Starter kit for pragmatics
Kotlin Multiplatform & Compose Multiplatform - Starter kit for pragmaticsKotlin Multiplatform & Compose Multiplatform - Starter kit for pragmatics
Kotlin Multiplatform & Compose Multiplatform - Starter kit for pragmatics
 
Key Features Of Token Development (1).pptx
Key  Features Of Token  Development (1).pptxKey  Features Of Token  Development (1).pptx
Key Features Of Token Development (1).pptx
 
Streamlining Python Development: A Guide to a Modern Project Setup
Streamlining Python Development: A Guide to a Modern Project SetupStreamlining Python Development: A Guide to a Modern Project Setup
Streamlining Python Development: A Guide to a Modern Project Setup
 
Designing IA for AI - Information Architecture Conference 2024
Designing IA for AI - Information Architecture Conference 2024Designing IA for AI - Information Architecture Conference 2024
Designing IA for AI - Information Architecture Conference 2024
 
Unleash Your Potential - Namagunga Girls Coding Club
Unleash Your Potential - Namagunga Girls Coding ClubUnleash Your Potential - Namagunga Girls Coding Club
Unleash Your Potential - Namagunga Girls Coding Club
 
Build your next Gen AI Breakthrough - April 2024
Build your next Gen AI Breakthrough - April 2024Build your next Gen AI Breakthrough - April 2024
Build your next Gen AI Breakthrough - April 2024
 
Vulnerability_Management_GRC_by Sohang Sengupta.pptx
Vulnerability_Management_GRC_by Sohang Sengupta.pptxVulnerability_Management_GRC_by Sohang Sengupta.pptx
Vulnerability_Management_GRC_by Sohang Sengupta.pptx
 
My INSURER PTE LTD - Insurtech Innovation Award 2024
My INSURER PTE LTD - Insurtech Innovation Award 2024My INSURER PTE LTD - Insurtech Innovation Award 2024
My INSURER PTE LTD - Insurtech Innovation Award 2024
 
AI as an Interface for Commercial Buildings
AI as an Interface for Commercial BuildingsAI as an Interface for Commercial Buildings
AI as an Interface for Commercial Buildings
 
Install Stable Diffusion in windows machine
Install Stable Diffusion in windows machineInstall Stable Diffusion in windows machine
Install Stable Diffusion in windows machine
 

Psuedocode1, algorithm1, Flowchart1.pptx

  • 2. Algorithm  A typical programming task can be divided into two phases:  Problem solving phase  Implementation phase  Algorithm is a written series of logical instructions which accomplish solution to a problem.  Pseudo code is an artificial and informal language that helps to develop algorithms which is similar to everyday English
  • 3. Flowchart  Flowchart shows graphical representation of a sequence of steps involved in a program (algorithm)  The two major types of flowchart:  System flowchart – depicts the entire data flow from one program to another throughout a system. It provides a logical diagram of how the system operates.  Program flowchart – depicts the series of operations that the computer follows to generate the desired information. It represents in detail, the various steps to be performed within the system for transforming the
  • 4. Flowchart Symbols Name Symbol Use in Flowchart Terminal Defines the starting and ending point of flowchart Initialization The preparation/initialization of memory space for data processing Input/Output The inputting of data for processing, and the printing out of processed data Process Manipulation of data (assignments and mathematical computations) Predefined Process Manipulation of data (assignments and mathematical computations) in function/subroutine form Decision Process conditions using relational operators. Used for trapping and filtering data Flow Lines Defines the logical sequence of the program. It points to the next symbol to be performed On-page Connector Connects the flowchart to avoid spaghetti connection on the same page Off-page Connector Connects the flowchart to avoid spaghetti connection on different page
  • 5. Basic Control Structure  Used to organize the flow of control in an algorithm  Also called single entry/single exit structure, there are three basic structure:  Sequence – the process is execute from one to another in a straight forward manner Entry Exit
  • 6. Basic Control Structure  Selection – a choice is provided between two alternatives  The condition to be tested  Process/statement to be performed if the condition is satisfied  Process/statement to be performed if the condition is satisfied True False Exit Entry
  • 7. Basic Control Structure  Iteration/Repetitive or loop control – provides a means of repeating part of an instruction without rewriting that part of an instruction  Body of the loop  Loop-exit condition Entry Exit
  • 8. Example No. 1  Pseudo code: 1. Print “Enter your name” 2. Input a name 3. Print “Hello” and the name inputted  Algorithm: 1. Print “Enter your name” 2. Input Name 3. Print “Hello”, Name
  • 9. Example No. 1 Flowchart: Start Name Print (“Enter your name”) Input Name Print (“Hello”), Name Stop Sample Output: Enter your name Shein Hello Shein
  • 10. Example No. 2  Pseudo code: 1. Print “The program will add 2 numbers:” 2. Print “Input the first number:” 3. Input the first number 4. Print “Input the second number:” 5. Input the second number 6. Calculate the sum of the two numbers 7. Print “The sum is”, and the sum of the two numbers
  • 11. Example No. 2  Algorithm: 1. Print “The program will add 2 numbers:” 2. Print “Input the first number:” 3. Input fst 4. Print “Input the second number:” 5. Input sec 6. Sum = fst + sec 7. Print “The sum is”, Sum
  • 12. Example No. 2 Flowchart: Start fst, sec, Sum Print (“The program will add 2 numbers:”) Print “Input the first number:” Input fst 1 1 Print (“Input the second number:”) Input sec Print (“The sum is”, Sum) Sum = fst + sec Stop
  • 13. How many hours did you work? START Print(“How many hours did you work?”) Input Hours Print(“How much do you get paid per hour?”) Input PayRate Print (“Gross Pay”, GrossPay) END Variable Contents: Hours: ? Pay Rate: ? Gross Pay: ? Output Operation Stepping through the Flowchart GrossPay=Hours * PayRate
  • 14. How many hours did you work? 40 START Print(“How many hours did you work?”) Input Hours Print(“How much do you get paid per hour?”) Input PayRate Print (“Gross Pay”, GrossPay) END Variable Contents: Hours: 40 Pay Rate: ? Gross Pay: ? Input Operation (User types 40) GrossPay=Hours * PayRate Stepping through the Flowchart
  • 15. How much do you get paid per hour? START Print(“How many hours did you work?”) Input Hours Print(“How much do you get paid per hour?”) Input PayRate Print (“Gross Pay”, GrossPay) END Variable Contents: Hours: 40 Pay Rate: ? Gross Pay: ? Output Operation GrossPay=Hours * PayRate Stepping through the Flowchart
  • 16. How much do you get paid per hour? 20 START Print(“How many hours did you work?”) Input Hours Print(“How much do you get paid per hour?”) Input PayRate Print (“Gross Pay”, GrossPay) END Variable Contents: Hours: 40 Pay Rate: 20 Gross Pay: ? Input Operation (User types 20) GrossPay=Hours * PayRate Stepping through the Flowchart
  • 17. How much do you get paid per hour? 20 START Print(“How many hours did you work?”) Input Hours Print(“How much do you get paid per hour?”) Input PayRate GrossPay=Hours * PayRate Print (“Gross Pay”, GrossPay) END Variable Contents: Hours: 40 PayRate: 20 GrossPay: 800 Process: The product of 40 times 20 is stored in Gross Pay Stepping through the Flowchart
  • 18. START Print(“How many hours did you work?”) Input Hours Print(“How much do you get paid per hour?”) Input PayRate Print (“Gross Pay”, GrossPay) END Variable Contents: Hours: 40 Pay Rate: 20 Gross Pay: 800 Output Operation Gross pay is 800 GrossPay=Hours * PayRate Stepping through the Flowchart
  • 19. Example No.3 1. Create a flowchart that computes the product and the quotient of two numbers.
  • 20. Start n1,n2, prod,quo Print (“ Enter two numbers”) prod=n1* n2 quo=n1/ n2 1 1 Print (“ The Product of two numbers :”, prod) Print (“ The Quotient of two numbers :”, quo) Stop Example No.3 Input n1, n2
  • 21. Seatwork: 1. Create a flowchart that will convert inches to centimeter. Wherein, 1 inch = 2.54cm.
  • 22. Start inch, cen Print (“ Enter Inch(es)”) cen=inch* 2.54 Print (“ Converted Inche(s)”, cen) Stop Input inch
  • 23. Additional exercises: Add 10 and 20 Algorithm (in simple English)  Initialize sum = 0 (PROCESS)  Enter the numbers (I/O)  Add them and store the result in sum (PROCESS)  Print sum (I/O)  Flowchart
  • 24.
  • 25. Find the sum of 5 numbers Algorithm (in simple English) 1. Initialize sum = 0 and count = 0 (PROCESS) 2. Enter n (I/O) 3. Find sum + n and assign it to sum and then increment count by 1 (PROCESS) 4. Is count < 5 (DECISION) 5. if YES go to step 2 else Print sum (I/O)
  • 26.
  • 27. Print Hello World 10 times Algorithm (in simple English 1. Initialize count = 0 (PROCESS) 2. Print Hello World (I/O) 3. Increment count by 1 (PROCESS) 4. Is count < 10 (DECISION) 5. if YES go to step 2 else Stop
  • 28.
  • 29. Draw a flowchart to log in to facebook account Algorithm (in simple English) 1. Enter www.facebook.com in your browser. (I/O) 2. facebook Home page loads (PROCESS) 3. Enter your Email ID and Password (I/O) 4. Is Email ID and Password Valid (DECISION) if NO then Log in error (PROCESS) go to step 3 else
  • 30.
  • 31. Find the sum of the numbers in each set. You are given hundred numbers divided in ten sets in the following order. Set 1: 1-10 Set 2: 11-20 Set 3: 21-30 … Set 10: 91-100
  • 32. Algorithm in simple English Initialize count = 1 and i = 1 (PROCESS) Check if i is less than or equal to 10 (DECISION) if YES then perform step 3 else STOP Set sum = 0 and j = 1 (PROCESS) Check if j is less than or equal to 10 (DECISION) if YES then perform step 5 else perform step 9 Add count to sum sum = sum + count (PROCESS) Increment count by 1 count = count + 1 (PROCESS) Increment j by 1 j = j + 1 (PROCESS) Go to Step 4 Print sum (I/O) Increment i by 1 i = i + 1 (PROCESS) Go to Step 2

Editor's Notes

  1. Problem Solving: Analysis and Specification Understand (define) the problem and what the solution must do Algorithm Development Develop a comprehensive unambiguous logical sequence of steps to solve the problem Verification of Algorithm Follow steps closely (manually) to see if solution works Implementation Phase: Program Development Translate algorithm into a program written in a programming language Program Testing Test program for syntactical and logical errors. Fix the errors. Algorithm vs. Pseudocodes Algorithm is basically a step by step procedure to solve a particular problem . Pseudocode is the informal representation of the code, doesn't follow rules of the language