SlideShare ist ein Scribd-Unternehmen logo
1 von 24
Program Flowchart, Pseudocode
& Algorithm development
Project 1
Exercise # 8, page 57
Bohl & Rynn’s textbook
Due date: February 3rd
, 2003
2
Learning Objectives
Understand the relation between
Algorithm and Pseudocode or program
flowchart
Draw flowcharts
Write pseudocodes
3
Recall form Class 2 & 3
Use of tools by analyst/programmer in
SDLC
Design/Programming tools used for:
Specifying problem-solving logic
4
Pseudocode:
English-language
statements that describe
the processing steps of a
program in paragraph
form.
START
READ EMPLOYEE DATA
COMPUTE GROSS PAY
COMPUTE DEDUCTIONS
COMPUTE NET PAY
WRITE EMPLOYEE PAYCHECK
STOP
Example
Algorithm ?
Step-by-step procedure to solve a
problem
An algorithm can be expressed using:
A System Flowchart
A Program Flowchart
A Pseudocode, etc.
Any algorithm must meet the following
requirements:
Use operations from only a given set of basic
operations (+,-,/,*,<,>…)
5
Example of algorithm (program flowchart)
6
REGSALES = Regular sales amount
SALESALES = Reduced sales amount
REGCOM = Regular commission (6%)
SALESCOM = Sales commission (3%)
PAY = Total pay due
Algorithm for determining salespersons’ pay
I
P
O
Algorithm vocabulary
7
START
STOP
SYMBOLS NAME
Terminal interrupt
symbols
USE
Terminal point (start,
stop, or break)
Input/Output symbol Reading data from an input medium
or writing data to an output medium
Process symbol Processing input data
Algorithm vocabulary
8
SYMBOLS NAME
Flowline symbol
USE
Sequence of operations and
direction of data flow
Decision symbol Decision-making operations
Predefined-process
symbol
Operations specified elsewhere (not
in the current algorithm)
Algorithm vocabulary
9
SYMBOLS NAME
Connector symbol
USE
Exit to, or entry from, another
part of the Flowchart
Preparation symbol Control operations: Set limit on
loop-control variables, Initialize
accumulators, etc.
Algorithm vocabulary
Item Meaning Example Comment
10
Variables
Data
independence
Assignment
statement
Constant
Data items whose
values may change, or
vary during processing
Using Variables instead of
their specific values gives a
program the capacity to
perform processing on any
set of input data.
Statement that assign a
value (calculated or
not) to a variable
A value that doesn’t
change
REGCOM =
REGSALES
*.06
READ
REGSALES,
SALESALES
READ
$1000,
$3000
.06
1) Variables names are place-
holders for values
2) Variable names are chosen
by programmer
3) Names should be descriptive
The computer will
perform the calculation
first, and then, assign
the result to REGCOM
IFTHENELSE / DECISION SYMBOL
11
Is
Condition
True ?
Processing 1
Processing 2
Processing 3
:
:
:
:
General form
AMOUNT
> 200 ?
DISCOUNT =
AMOUNT * .10
SUBBIL =
AMOUNT –
DISCOUNT
SUBBIL=
AMOUNT
:
:
An Example
READ
AMOUNT
YESNO YESNO
Could be many
processings,…
Could be many
processings,…
Exercise 1: Tuition bill Problem
12
Write the program flowchart to prepare a tuition bill.
The input will contain the student name, Social
Security Number, and total number of credits for
which the student has enrolled. The bill will contain
the student name, Social Security Number, and
computed tuition. Total credits of 10 or more indicate
that the student is full-time. Full-time students pay a
flat rate of $1000 for tuition. Total credits of less than
10 indicate that the student is part-time. Part-time
students pay $100 per credit for tuition.
Exercise 11 (Chapter 3)
Exercise 1’s solution: (Part 1: System
Flowchart)
13
(To be done in class)
Exercise 1 solution: (Part 2: Program
Flowchart)
14
(To be done in class)
Project 1
15
Write a program flowchart and
corresponding pseudocode to solve the
following problem: Assume the input for a
student is name, student number, and
three grades. Output the student name and
an S (Success) if the average of the three
grades is 65 or more. Otherwise (else),
output the student’s name, a U
(Unsuccess), and the number of additional
points needed for an S.
Exercise 2: Billing problem
16
Look at the program flowchart on the next slide, and answer the following questions:
(a) For what variables are values read as input ?
(b) What variables’ values are output ?
(c) What constants are used ?
(d) Simulate the execution of this algorithm, assuming the values shown below are
read as input for the first four variables named.
Exercise 11 (Chapter 2)
Blouse
3
49.99
Mrs. A. B. Wallace
ITEM
QTY
PRICE
AMTOD
DISCOUNT
NAME
SUBBILL
TAXES
BILL
Exercise 2: Billing problem
17
Exercise 11 (Chapter 2)
START
READ NAME,
ITEM, QTY,
PRICE
AMTOD =
QTY * PRICE
DISCOUNT =
AMTOD * .10
SUBBILL =
AMTOD - DISCOUNT
TAXES =
SUBBILL * .05
BILL =
SUBBILL + TAXES
WRITE NAME,
ITEM, BILL
STOP
Exercise 1 solution: Program Flowchart &
corresponding Pseudocode
18
READ
NAME, SSN,
CREDITS
WRITE
NAME, SSN, TUITION
CREDITS
≥ 10 ?
TUITION = 1000TUITION =
100 * CREDITS
START
STOP
Start
Read NAME, SSN, CREDITS
IF CREDITS >= 10 THEN
TUITION = 1000
ELSE
TUITION = 100 * CREDITS
ENDIF
Write NAME, SSN, TUITION
Stop
Pseudocode for Tuition problem
NO YES
Pseudocode
Other common way to represent
algorithms
Similar to programming languages like
Visual Basic but
Does not require strict rules as programming
languages
19
Start
Read NAME, SSN, CREDITS
IF CREDITS >= 10 THEN
TUITION = 1000
ELSE
TUITION = 100 * CREDITS
ENDIF
Write NAME, SSN, TUITION
Stop
Pseudocode for Tuition problem (see Slide12)
UPPERCASE for variable names
UPPERCASE for Reserved words
Lowercase for non- reserved words
Titlecase
Pseudocode
20
Start
Read NAME, SSN, CREDITS
IF CREDITS >= 10 THEN
TUITION = 1000
ELSE
TUITION = 100 * CREDITS
ENDIF
Write NAME, SSN, TUITION
Stop
Pseudocode for Tuition problem (see Slide12)
Use of indentation (i.e. clauses are
indented a few positions) for
clarity
Exercise 3: Weekly Payroll problem
21
Construct a program flowchart and corresponding
pseudocode to solve the following problem: ABC company
needs a weekly payroll report for its salespeople. Input to
the program is a salesperson’s name, number, and weekly
sales. Output is the salesperson’s name, number, and pay.
Each salesperson receives a base pay of $300 as well as a
10% commission on his or her total sales up to and
including $500. Any sales over $500 merit a 15%
commission for the employee. (For example, if sales =
$600, then pay = $300 + $50 [or .10 * 500] + $15 [.15 * 100]
= $350). Use a DOWHILE loop and a counter to compute
the weekly payroll for exactly 20 employees.
Exercise 19 (Chapter 4)
Exercise 3’s solution: (Part 1: System
Flowchart)
22
NAME, NUM,
SALES
WEEKLY
PAYROLL
PROGRAM
NAME, NUM,
PAY
Algorithm Development Process
Design verification, in order to:
 Prevent errors from occurring
 Detect and correct errors soon
Selection of Review Team members for:
 Informal design review or
 Structured design review
Structured Design Review:
 Selection of representative values of input (data normally
expected, extreme values, invalid data)
 Following designed algorithms to determine what output are
produce.
23
Summary Questions
1. Distinguish between Algorithm on the
one hand, and Program flowchart and
Pseudocode on the other hand. Discuss
the relations between the two.
2. (a) List the main keywords used in
Pseudocodes. (b) What control structures
they represent.
You should know how to design
program logic using Program Flowcharts
& Pseudocodes (Review Exercises 1,2,3
above & Exercise 15 Ch.4 and answer on
page 339)
24

Weitere ähnliche Inhalte

Was ist angesagt?

Algorithms and flowcharts
Algorithms and flowchartsAlgorithms and flowcharts
Algorithms and flowchartsSamuel Igbanogu
 
Algorithm and flowchart
Algorithm and flowchartAlgorithm and flowchart
Algorithm and flowchartSachin Goyani
 
What is an algorithm?
What is an algorithm?What is an algorithm?
What is an algorithm?Angela DeHart
 
TOC 1 | Introduction to Theory of Computation
TOC 1 | Introduction to Theory of ComputationTOC 1 | Introduction to Theory of Computation
TOC 1 | Introduction to Theory of ComputationMohammad Imam Hossain
 
Flow chart and pseudo code
Flow chart and pseudo code Flow chart and pseudo code
Flow chart and pseudo code Niva tharan
 
Pseudocode flowcharts
Pseudocode flowchartsPseudocode flowcharts
Pseudocode flowchartsnicky_walters
 
Intro automata theory
Intro automata theory Intro automata theory
Intro automata theory Rajendran
 
Operators in c programming
Operators in c programmingOperators in c programming
Operators in c programmingsavitamhaske
 
Theory of automata and formal language
Theory of automata and formal languageTheory of automata and formal language
Theory of automata and formal languageRabia Khalid
 
Flowchart and algorithm
Flowchart and algorithmFlowchart and algorithm
Flowchart and algorithmDHANIK VIKRANT
 
Programming Fundamental Presentation
Programming Fundamental PresentationProgramming Fundamental Presentation
Programming Fundamental Presentationfazli khaliq
 
Theory of Computation "Chapter 1, introduction"
Theory of Computation "Chapter 1, introduction"Theory of Computation "Chapter 1, introduction"
Theory of Computation "Chapter 1, introduction"Ra'Fat Al-Msie'deen
 
structured programming Introduction to c fundamentals
structured programming Introduction to c fundamentalsstructured programming Introduction to c fundamentals
structured programming Introduction to c fundamentalsOMWOMA JACKSON
 
Lecture 1,2
Lecture 1,2Lecture 1,2
Lecture 1,2shah zeb
 
Algorithm and pseudo codes
Algorithm and pseudo codesAlgorithm and pseudo codes
Algorithm and pseudo codeshermiraguilar
 
Lecture 3,4
Lecture 3,4Lecture 3,4
Lecture 3,4shah zeb
 

Was ist angesagt? (20)

Algorithms and flowcharts
Algorithms and flowchartsAlgorithms and flowcharts
Algorithms and flowcharts
 
Algorithm and flowchart
Algorithm and flowchartAlgorithm and flowchart
Algorithm and flowchart
 
Set in discrete mathematics
Set in discrete mathematicsSet in discrete mathematics
Set in discrete mathematics
 
What is an algorithm?
What is an algorithm?What is an algorithm?
What is an algorithm?
 
TOC 1 | Introduction to Theory of Computation
TOC 1 | Introduction to Theory of ComputationTOC 1 | Introduction to Theory of Computation
TOC 1 | Introduction to Theory of Computation
 
Flow chart and pseudo code
Flow chart and pseudo code Flow chart and pseudo code
Flow chart and pseudo code
 
Pseudocode flowcharts
Pseudocode flowchartsPseudocode flowcharts
Pseudocode flowcharts
 
Intro automata theory
Intro automata theory Intro automata theory
Intro automata theory
 
Operators in c programming
Operators in c programmingOperators in c programming
Operators in c programming
 
Theory of automata and formal language
Theory of automata and formal languageTheory of automata and formal language
Theory of automata and formal language
 
Programming Fundamentals
Programming FundamentalsProgramming Fundamentals
Programming Fundamentals
 
Flowchart and algorithm
Flowchart and algorithmFlowchart and algorithm
Flowchart and algorithm
 
Programming Fundamental Presentation
Programming Fundamental PresentationProgramming Fundamental Presentation
Programming Fundamental Presentation
 
Theory of Computation "Chapter 1, introduction"
Theory of Computation "Chapter 1, introduction"Theory of Computation "Chapter 1, introduction"
Theory of Computation "Chapter 1, introduction"
 
Methods in Java
Methods in JavaMethods in Java
Methods in Java
 
structured programming Introduction to c fundamentals
structured programming Introduction to c fundamentalsstructured programming Introduction to c fundamentals
structured programming Introduction to c fundamentals
 
Lecture 1,2
Lecture 1,2Lecture 1,2
Lecture 1,2
 
Algorithm and pseudo codes
Algorithm and pseudo codesAlgorithm and pseudo codes
Algorithm and pseudo codes
 
Lecture 3,4
Lecture 3,4Lecture 3,4
Lecture 3,4
 
algo
algoalgo
algo
 

Andere mochten auch

Algorithms and Flowcharts
Algorithms and FlowchartsAlgorithms and Flowcharts
Algorithms and FlowchartsDeva Singh
 
Algorithmsandflowcharts1
Algorithmsandflowcharts1Algorithmsandflowcharts1
Algorithmsandflowcharts1luhkahreth
 
Unit 3 Foc
Unit  3 FocUnit  3 Foc
Unit 3 FocJAYA
 
Automating Quantitative Narrative Analysis of News Data
Automating Quantitative Narrative Analysis of News DataAutomating Quantitative Narrative Analysis of News Data
Automating Quantitative Narrative Analysis of News DataSaatviga Sudhahar
 
Basic concepts
Basic conceptsBasic concepts
Basic conceptsHuma Ayub
 
Pseudocode
PseudocodePseudocode
PseudocodeGuy09
 
Algoritma pemrogmraman
Algoritma pemrogmramanAlgoritma pemrogmraman
Algoritma pemrogmramannoval riansyah
 
Pseudocode basics
Pseudocode basicsPseudocode basics
Pseudocode basicskiran_kaur
 
Algoritma dan Struktur Data - Pseudocode
Algoritma dan Struktur Data - PseudocodeAlgoritma dan Struktur Data - Pseudocode
Algoritma dan Struktur Data - PseudocodeGeorgius Rinaldo
 
The pseudocode
The pseudocodeThe pseudocode
The pseudocodeAsha Sari
 
Algoritma dan Pemrograman C++ (Pseudocode & Flowchart)
Algoritma dan Pemrograman C++ (Pseudocode & Flowchart)Algoritma dan Pemrograman C++ (Pseudocode & Flowchart)
Algoritma dan Pemrograman C++ (Pseudocode & Flowchart)Nabil Muhammad Firdaus
 
03 algoritma flowchart
03 algoritma flowchart03 algoritma flowchart
03 algoritma flowchartArif Rahman
 
A complete course in Program Design using Pseudocode
A complete course in Program Design using Pseudocode A complete course in Program Design using Pseudocode
A complete course in Program Design using Pseudocode Damian T. Gordon
 

Andere mochten auch (20)

Algorithms and Flowcharts
Algorithms and FlowchartsAlgorithms and Flowcharts
Algorithms and Flowcharts
 
Writing algorithms
Writing algorithmsWriting algorithms
Writing algorithms
 
Algorithmsandflowcharts1
Algorithmsandflowcharts1Algorithmsandflowcharts1
Algorithmsandflowcharts1
 
Flowchart and algorithm
Flowchart and algorithmFlowchart and algorithm
Flowchart and algorithm
 
Algorithm and flowchart
Algorithm and flowchartAlgorithm and flowchart
Algorithm and flowchart
 
Unit 3 Foc
Unit  3 FocUnit  3 Foc
Unit 3 Foc
 
Automating Quantitative Narrative Analysis of News Data
Automating Quantitative Narrative Analysis of News DataAutomating Quantitative Narrative Analysis of News Data
Automating Quantitative Narrative Analysis of News Data
 
Flowcharts
FlowchartsFlowcharts
Flowcharts
 
Basic concepts
Basic conceptsBasic concepts
Basic concepts
 
Pseudocode
PseudocodePseudocode
Pseudocode
 
Pseudocode
PseudocodePseudocode
Pseudocode
 
Algoritma pemrogmraman
Algoritma pemrogmramanAlgoritma pemrogmraman
Algoritma pemrogmraman
 
Pseudocode basics
Pseudocode basicsPseudocode basics
Pseudocode basics
 
Algoritma dan Struktur Data - Pseudocode
Algoritma dan Struktur Data - PseudocodeAlgoritma dan Struktur Data - Pseudocode
Algoritma dan Struktur Data - Pseudocode
 
The pseudocode
The pseudocodeThe pseudocode
The pseudocode
 
03 pseudocode
03 pseudocode03 pseudocode
03 pseudocode
 
Tugas algoritma ( flowchart )
Tugas algoritma ( flowchart )Tugas algoritma ( flowchart )
Tugas algoritma ( flowchart )
 
Algoritma dan Pemrograman C++ (Pseudocode & Flowchart)
Algoritma dan Pemrograman C++ (Pseudocode & Flowchart)Algoritma dan Pemrograman C++ (Pseudocode & Flowchart)
Algoritma dan Pemrograman C++ (Pseudocode & Flowchart)
 
03 algoritma flowchart
03 algoritma flowchart03 algoritma flowchart
03 algoritma flowchart
 
A complete course in Program Design using Pseudocode
A complete course in Program Design using Pseudocode A complete course in Program Design using Pseudocode
A complete course in Program Design using Pseudocode
 

Ähnlich wie Pseudocode algorithim flowchart

POLITEKNIK MALAYSIA
POLITEKNIK MALAYSIAPOLITEKNIK MALAYSIA
POLITEKNIK MALAYSIAAiman Hud
 
COMP 122 Entire Course NEW
COMP 122 Entire Course NEWCOMP 122 Entire Course NEW
COMP 122 Entire Course NEWshyamuopeight
 
Visual Basic Review - ICA
Visual Basic Review - ICAVisual Basic Review - ICA
Visual Basic Review - ICAemtrajano
 
Week 2PRG 218 Variables and Input and Output OperationsWrite.docx
Week 2PRG 218   Variables and Input and Output OperationsWrite.docxWeek 2PRG 218   Variables and Input and Output OperationsWrite.docx
Week 2PRG 218 Variables and Input and Output OperationsWrite.docxmelbruce90096
 
Student Lab Activity A. Lab # CIS CIS170A-A1B. Lab.docx
Student Lab Activity A. Lab # CIS CIS170A-A1B. Lab.docxStudent Lab Activity A. Lab # CIS CIS170A-A1B. Lab.docx
Student Lab Activity A. Lab # CIS CIS170A-A1B. Lab.docxemelyvalg9
 
Cis 115 week 7 i lab sales tax solution
Cis 115 week 7 i lab sales tax solutionCis 115 week 7 i lab sales tax solution
Cis 115 week 7 i lab sales tax solutionarnitaetsitty
 
Chapter 16-spreadsheet1 questions and answer
Chapter 16-spreadsheet1  questions and answerChapter 16-spreadsheet1  questions and answer
Chapter 16-spreadsheet1 questions and answerRaajTech
 
Comp 122 lab 2 lab report and source code
Comp 122 lab 2 lab report and source codeComp 122 lab 2 lab report and source code
Comp 122 lab 2 lab report and source codepradesigali1
 
Part I (Short Answer)1. In Java, what are the three different w.docx
Part I (Short Answer)1. In Java, what are the three different w.docxPart I (Short Answer)1. In Java, what are the three different w.docx
Part I (Short Answer)1. In Java, what are the three different w.docxherbertwilson5999
 
Chapter 8Exercise1.Design an application that accept.docx
Chapter 8Exercise1.Design an application that accept.docxChapter 8Exercise1.Design an application that accept.docx
Chapter 8Exercise1.Design an application that accept.docxtiffanyd4
 
COMP 2213X2 Assignment #2 Parts A and BDue February 3 in cla.docx
COMP 2213X2 Assignment #2 Parts A and BDue February 3 in cla.docxCOMP 2213X2 Assignment #2 Parts A and BDue February 3 in cla.docx
COMP 2213X2 Assignment #2 Parts A and BDue February 3 in cla.docxdonnajames55
 
Statement of Operations and Financial StatementsSubmit written r.docx
Statement of Operations and Financial StatementsSubmit written r.docxStatement of Operations and Financial StatementsSubmit written r.docx
Statement of Operations and Financial StatementsSubmit written r.docxwhitneyleman54422
 
Pooja Bijawat,Bachelor Degree in Computer Application
Pooja Bijawat,Bachelor Degree in Computer ApplicationPooja Bijawat,Bachelor Degree in Computer Application
Pooja Bijawat,Bachelor Degree in Computer Applicationdezyneecole
 

Ähnlich wie Pseudocode algorithim flowchart (20)

POLITEKNIK MALAYSIA
POLITEKNIK MALAYSIAPOLITEKNIK MALAYSIA
POLITEKNIK MALAYSIA
 
COMP 122 Entire Course NEW
COMP 122 Entire Course NEWCOMP 122 Entire Course NEW
COMP 122 Entire Course NEW
 
Visual Basic Review - ICA
Visual Basic Review - ICAVisual Basic Review - ICA
Visual Basic Review - ICA
 
Week 2PRG 218 Variables and Input and Output OperationsWrite.docx
Week 2PRG 218   Variables and Input and Output OperationsWrite.docxWeek 2PRG 218   Variables and Input and Output OperationsWrite.docx
Week 2PRG 218 Variables and Input and Output OperationsWrite.docx
 
Student Lab Activity A. Lab # CIS CIS170A-A1B. Lab.docx
Student Lab Activity A. Lab # CIS CIS170A-A1B. Lab.docxStudent Lab Activity A. Lab # CIS CIS170A-A1B. Lab.docx
Student Lab Activity A. Lab # CIS CIS170A-A1B. Lab.docx
 
Cis 115 week 7 i lab sales tax solution
Cis 115 week 7 i lab sales tax solutionCis 115 week 7 i lab sales tax solution
Cis 115 week 7 i lab sales tax solution
 
Chapter 16-spreadsheet1 questions and answer
Chapter 16-spreadsheet1  questions and answerChapter 16-spreadsheet1  questions and answer
Chapter 16-spreadsheet1 questions and answer
 
Comp 122 lab 2 lab report and source code
Comp 122 lab 2 lab report and source codeComp 122 lab 2 lab report and source code
Comp 122 lab 2 lab report and source code
 
Part I (Short Answer)1. In Java, what are the three different w.docx
Part I (Short Answer)1. In Java, what are the three different w.docxPart I (Short Answer)1. In Java, what are the three different w.docx
Part I (Short Answer)1. In Java, what are the three different w.docx
 
Chapter 8Exercise1.Design an application that accept.docx
Chapter 8Exercise1.Design an application that accept.docxChapter 8Exercise1.Design an application that accept.docx
Chapter 8Exercise1.Design an application that accept.docx
 
COMP 2213X2 Assignment #2 Parts A and BDue February 3 in cla.docx
COMP 2213X2 Assignment #2 Parts A and BDue February 3 in cla.docxCOMP 2213X2 Assignment #2 Parts A and BDue February 3 in cla.docx
COMP 2213X2 Assignment #2 Parts A and BDue February 3 in cla.docx
 
Lecture 1
Lecture 1Lecture 1
Lecture 1
 
3 algorithm-and-flowchart
3 algorithm-and-flowchart3 algorithm-and-flowchart
3 algorithm-and-flowchart
 
Statement of Operations and Financial StatementsSubmit written r.docx
Statement of Operations and Financial StatementsSubmit written r.docxStatement of Operations and Financial StatementsSubmit written r.docx
Statement of Operations and Financial StatementsSubmit written r.docx
 
Unit-I Algorithm.pptx
Unit-I Algorithm.pptxUnit-I Algorithm.pptx
Unit-I Algorithm.pptx
 
Chapter 2- Prog101.ppt
Chapter 2- Prog101.pptChapter 2- Prog101.ppt
Chapter 2- Prog101.ppt
 
Cocomomodel
CocomomodelCocomomodel
Cocomomodel
 
COCOMO Model
COCOMO ModelCOCOMO Model
COCOMO Model
 
Cocomo model
Cocomo modelCocomo model
Cocomo model
 
Pooja Bijawat,Bachelor Degree in Computer Application
Pooja Bijawat,Bachelor Degree in Computer ApplicationPooja Bijawat,Bachelor Degree in Computer Application
Pooja Bijawat,Bachelor Degree in Computer Application
 

Mehr von fika sweety

Query optimization and performance
Query optimization and performanceQuery optimization and performance
Query optimization and performancefika sweety
 
Program design techniques
Program design techniquesProgram design techniques
Program design techniquesfika sweety
 
Modeling and simulation ch 1
Modeling and simulation ch 1Modeling and simulation ch 1
Modeling and simulation ch 1fika sweety
 
Macros...presentation
Macros...presentationMacros...presentation
Macros...presentationfika sweety
 
Howtowriteamemo 090920105907-phpapp02
Howtowriteamemo 090920105907-phpapp02Howtowriteamemo 090920105907-phpapp02
Howtowriteamemo 090920105907-phpapp02fika sweety
 
Coal presentationt
Coal presentationtCoal presentationt
Coal presentationtfika sweety
 
1 Computer Architecture
1 Computer Architecture1 Computer Architecture
1 Computer Architecturefika sweety
 
Warehouse chapter3
Warehouse chapter3   Warehouse chapter3
Warehouse chapter3 fika sweety
 
Query optimization and performance
Query optimization and performanceQuery optimization and performance
Query optimization and performancefika sweety
 
Database security copy
Database security   copyDatabase security   copy
Database security copyfika sweety
 

Mehr von fika sweety (20)

Query optimization and performance
Query optimization and performanceQuery optimization and performance
Query optimization and performance
 
Program design techniques
Program design techniquesProgram design techniques
Program design techniques
 
Plsql
PlsqlPlsql
Plsql
 
Shift rotate
Shift rotateShift rotate
Shift rotate
 
Graphss
GraphssGraphss
Graphss
 
Modeling and simulation ch 1
Modeling and simulation ch 1Modeling and simulation ch 1
Modeling and simulation ch 1
 
Macros...presentation
Macros...presentationMacros...presentation
Macros...presentation
 
Diversity (HRM)
Diversity (HRM)Diversity (HRM)
Diversity (HRM)
 
Howtowriteamemo 090920105907-phpapp02
Howtowriteamemo 090920105907-phpapp02Howtowriteamemo 090920105907-phpapp02
Howtowriteamemo 090920105907-phpapp02
 
Coal presentationt
Coal presentationtCoal presentationt
Coal presentationt
 
1 Computer Architecture
1 Computer Architecture1 Computer Architecture
1 Computer Architecture
 
3 Pipelining
3 Pipelining3 Pipelining
3 Pipelining
 
19 primkruskal
19 primkruskal19 primkruskal
19 primkruskal
 
Warehouse chapter3
Warehouse chapter3   Warehouse chapter3
Warehouse chapter3
 
Storage memory
Storage memoryStorage memory
Storage memory
 
Quick sort
Quick sortQuick sort
Quick sort
 
Query optimization and performance
Query optimization and performanceQuery optimization and performance
Query optimization and performance
 
L2
L2L2
L2
 
Master theorem
Master theoremMaster theorem
Master theorem
 
Database security copy
Database security   copyDatabase security   copy
Database security copy
 

Kürzlich hochgeladen

KubeKraft presentation @CloudNativeHooghly
KubeKraft presentation @CloudNativeHooghlyKubeKraft presentation @CloudNativeHooghly
KubeKraft presentation @CloudNativeHooghlysanyuktamishra911
 
Top Rated Pune Call Girls Budhwar Peth ⟟ 6297143586 ⟟ Call Me For Genuine Se...
Top Rated  Pune Call Girls Budhwar Peth ⟟ 6297143586 ⟟ Call Me For Genuine Se...Top Rated  Pune Call Girls Budhwar Peth ⟟ 6297143586 ⟟ Call Me For Genuine Se...
Top Rated Pune Call Girls Budhwar Peth ⟟ 6297143586 ⟟ Call Me For Genuine Se...Call Girls in Nagpur High Profile
 
The Most Attractive Pune Call Girls Manchar 8250192130 Will You Miss This Cha...
The Most Attractive Pune Call Girls Manchar 8250192130 Will You Miss This Cha...The Most Attractive Pune Call Girls Manchar 8250192130 Will You Miss This Cha...
The Most Attractive Pune Call Girls Manchar 8250192130 Will You Miss This Cha...ranjana rawat
 
Call for Papers - Educational Administration: Theory and Practice, E-ISSN: 21...
Call for Papers - Educational Administration: Theory and Practice, E-ISSN: 21...Call for Papers - Educational Administration: Theory and Practice, E-ISSN: 21...
Call for Papers - Educational Administration: Theory and Practice, E-ISSN: 21...Christo Ananth
 
VIP Call Girls Ankleshwar 7001035870 Whatsapp Number, 24/07 Booking
VIP Call Girls Ankleshwar 7001035870 Whatsapp Number, 24/07 BookingVIP Call Girls Ankleshwar 7001035870 Whatsapp Number, 24/07 Booking
VIP Call Girls Ankleshwar 7001035870 Whatsapp Number, 24/07 Bookingdharasingh5698
 
Online banking management system project.pdf
Online banking management system project.pdfOnline banking management system project.pdf
Online banking management system project.pdfKamal Acharya
 
UNIT-III FMM. DIMENSIONAL ANALYSIS
UNIT-III FMM.        DIMENSIONAL ANALYSISUNIT-III FMM.        DIMENSIONAL ANALYSIS
UNIT-III FMM. DIMENSIONAL ANALYSISrknatarajan
 
Call for Papers - African Journal of Biological Sciences, E-ISSN: 2663-2187, ...
Call for Papers - African Journal of Biological Sciences, E-ISSN: 2663-2187, ...Call for Papers - African Journal of Biological Sciences, E-ISSN: 2663-2187, ...
Call for Papers - African Journal of Biological Sciences, E-ISSN: 2663-2187, ...Christo Ananth
 
Processing & Properties of Floor and Wall Tiles.pptx
Processing & Properties of Floor and Wall Tiles.pptxProcessing & Properties of Floor and Wall Tiles.pptx
Processing & Properties of Floor and Wall Tiles.pptxpranjaldaimarysona
 
University management System project report..pdf
University management System project report..pdfUniversity management System project report..pdf
University management System project report..pdfKamal Acharya
 
Call Girls Service Nashik Vaishnavi 7001305949 Independent Escort Service Nashik
Call Girls Service Nashik Vaishnavi 7001305949 Independent Escort Service NashikCall Girls Service Nashik Vaishnavi 7001305949 Independent Escort Service Nashik
Call Girls Service Nashik Vaishnavi 7001305949 Independent Escort Service NashikCall Girls in Nagpur High Profile
 
MANUFACTURING PROCESS-II UNIT-1 THEORY OF METAL CUTTING
MANUFACTURING PROCESS-II UNIT-1 THEORY OF METAL CUTTINGMANUFACTURING PROCESS-II UNIT-1 THEORY OF METAL CUTTING
MANUFACTURING PROCESS-II UNIT-1 THEORY OF METAL CUTTINGSIVASHANKAR N
 
(ANJALI) Dange Chowk Call Girls Just Call 7001035870 [ Cash on Delivery ] Pun...
(ANJALI) Dange Chowk Call Girls Just Call 7001035870 [ Cash on Delivery ] Pun...(ANJALI) Dange Chowk Call Girls Just Call 7001035870 [ Cash on Delivery ] Pun...
(ANJALI) Dange Chowk Call Girls Just Call 7001035870 [ Cash on Delivery ] Pun...ranjana rawat
 
ONLINE FOOD ORDER SYSTEM PROJECT REPORT.pdf
ONLINE FOOD ORDER SYSTEM PROJECT REPORT.pdfONLINE FOOD ORDER SYSTEM PROJECT REPORT.pdf
ONLINE FOOD ORDER SYSTEM PROJECT REPORT.pdfKamal Acharya
 
High Profile Call Girls Nagpur Meera Call 7001035870 Meet With Nagpur Escorts
High Profile Call Girls Nagpur Meera Call 7001035870 Meet With Nagpur EscortsHigh Profile Call Girls Nagpur Meera Call 7001035870 Meet With Nagpur Escorts
High Profile Call Girls Nagpur Meera Call 7001035870 Meet With Nagpur EscortsCall Girls in Nagpur High Profile
 
Sheet Pile Wall Design and Construction: A Practical Guide for Civil Engineer...
Sheet Pile Wall Design and Construction: A Practical Guide for Civil Engineer...Sheet Pile Wall Design and Construction: A Practical Guide for Civil Engineer...
Sheet Pile Wall Design and Construction: A Practical Guide for Civil Engineer...Dr.Costas Sachpazis
 
Russian Call Girls in Nagpur Grishma Call 7001035870 Meet With Nagpur Escorts
Russian Call Girls in Nagpur Grishma Call 7001035870 Meet With Nagpur EscortsRussian Call Girls in Nagpur Grishma Call 7001035870 Meet With Nagpur Escorts
Russian Call Girls in Nagpur Grishma Call 7001035870 Meet With Nagpur EscortsCall Girls in Nagpur High Profile
 
Introduction to IEEE STANDARDS and its different types.pptx
Introduction to IEEE STANDARDS and its different types.pptxIntroduction to IEEE STANDARDS and its different types.pptx
Introduction to IEEE STANDARDS and its different types.pptxupamatechverse
 
Call Girls Service Nagpur Tanvi Call 7001035870 Meet With Nagpur Escorts
Call Girls Service Nagpur Tanvi Call 7001035870 Meet With Nagpur EscortsCall Girls Service Nagpur Tanvi Call 7001035870 Meet With Nagpur Escorts
Call Girls Service Nagpur Tanvi Call 7001035870 Meet With Nagpur EscortsCall Girls in Nagpur High Profile
 

Kürzlich hochgeladen (20)

KubeKraft presentation @CloudNativeHooghly
KubeKraft presentation @CloudNativeHooghlyKubeKraft presentation @CloudNativeHooghly
KubeKraft presentation @CloudNativeHooghly
 
Top Rated Pune Call Girls Budhwar Peth ⟟ 6297143586 ⟟ Call Me For Genuine Se...
Top Rated  Pune Call Girls Budhwar Peth ⟟ 6297143586 ⟟ Call Me For Genuine Se...Top Rated  Pune Call Girls Budhwar Peth ⟟ 6297143586 ⟟ Call Me For Genuine Se...
Top Rated Pune Call Girls Budhwar Peth ⟟ 6297143586 ⟟ Call Me For Genuine Se...
 
The Most Attractive Pune Call Girls Manchar 8250192130 Will You Miss This Cha...
The Most Attractive Pune Call Girls Manchar 8250192130 Will You Miss This Cha...The Most Attractive Pune Call Girls Manchar 8250192130 Will You Miss This Cha...
The Most Attractive Pune Call Girls Manchar 8250192130 Will You Miss This Cha...
 
Call for Papers - Educational Administration: Theory and Practice, E-ISSN: 21...
Call for Papers - Educational Administration: Theory and Practice, E-ISSN: 21...Call for Papers - Educational Administration: Theory and Practice, E-ISSN: 21...
Call for Papers - Educational Administration: Theory and Practice, E-ISSN: 21...
 
VIP Call Girls Ankleshwar 7001035870 Whatsapp Number, 24/07 Booking
VIP Call Girls Ankleshwar 7001035870 Whatsapp Number, 24/07 BookingVIP Call Girls Ankleshwar 7001035870 Whatsapp Number, 24/07 Booking
VIP Call Girls Ankleshwar 7001035870 Whatsapp Number, 24/07 Booking
 
Online banking management system project.pdf
Online banking management system project.pdfOnline banking management system project.pdf
Online banking management system project.pdf
 
UNIT-III FMM. DIMENSIONAL ANALYSIS
UNIT-III FMM.        DIMENSIONAL ANALYSISUNIT-III FMM.        DIMENSIONAL ANALYSIS
UNIT-III FMM. DIMENSIONAL ANALYSIS
 
Call for Papers - African Journal of Biological Sciences, E-ISSN: 2663-2187, ...
Call for Papers - African Journal of Biological Sciences, E-ISSN: 2663-2187, ...Call for Papers - African Journal of Biological Sciences, E-ISSN: 2663-2187, ...
Call for Papers - African Journal of Biological Sciences, E-ISSN: 2663-2187, ...
 
Processing & Properties of Floor and Wall Tiles.pptx
Processing & Properties of Floor and Wall Tiles.pptxProcessing & Properties of Floor and Wall Tiles.pptx
Processing & Properties of Floor and Wall Tiles.pptx
 
University management System project report..pdf
University management System project report..pdfUniversity management System project report..pdf
University management System project report..pdf
 
Call Girls Service Nashik Vaishnavi 7001305949 Independent Escort Service Nashik
Call Girls Service Nashik Vaishnavi 7001305949 Independent Escort Service NashikCall Girls Service Nashik Vaishnavi 7001305949 Independent Escort Service Nashik
Call Girls Service Nashik Vaishnavi 7001305949 Independent Escort Service Nashik
 
MANUFACTURING PROCESS-II UNIT-1 THEORY OF METAL CUTTING
MANUFACTURING PROCESS-II UNIT-1 THEORY OF METAL CUTTINGMANUFACTURING PROCESS-II UNIT-1 THEORY OF METAL CUTTING
MANUFACTURING PROCESS-II UNIT-1 THEORY OF METAL CUTTING
 
(ANJALI) Dange Chowk Call Girls Just Call 7001035870 [ Cash on Delivery ] Pun...
(ANJALI) Dange Chowk Call Girls Just Call 7001035870 [ Cash on Delivery ] Pun...(ANJALI) Dange Chowk Call Girls Just Call 7001035870 [ Cash on Delivery ] Pun...
(ANJALI) Dange Chowk Call Girls Just Call 7001035870 [ Cash on Delivery ] Pun...
 
ONLINE FOOD ORDER SYSTEM PROJECT REPORT.pdf
ONLINE FOOD ORDER SYSTEM PROJECT REPORT.pdfONLINE FOOD ORDER SYSTEM PROJECT REPORT.pdf
ONLINE FOOD ORDER SYSTEM PROJECT REPORT.pdf
 
High Profile Call Girls Nagpur Meera Call 7001035870 Meet With Nagpur Escorts
High Profile Call Girls Nagpur Meera Call 7001035870 Meet With Nagpur EscortsHigh Profile Call Girls Nagpur Meera Call 7001035870 Meet With Nagpur Escorts
High Profile Call Girls Nagpur Meera Call 7001035870 Meet With Nagpur Escorts
 
Sheet Pile Wall Design and Construction: A Practical Guide for Civil Engineer...
Sheet Pile Wall Design and Construction: A Practical Guide for Civil Engineer...Sheet Pile Wall Design and Construction: A Practical Guide for Civil Engineer...
Sheet Pile Wall Design and Construction: A Practical Guide for Civil Engineer...
 
Russian Call Girls in Nagpur Grishma Call 7001035870 Meet With Nagpur Escorts
Russian Call Girls in Nagpur Grishma Call 7001035870 Meet With Nagpur EscortsRussian Call Girls in Nagpur Grishma Call 7001035870 Meet With Nagpur Escorts
Russian Call Girls in Nagpur Grishma Call 7001035870 Meet With Nagpur Escorts
 
Introduction to IEEE STANDARDS and its different types.pptx
Introduction to IEEE STANDARDS and its different types.pptxIntroduction to IEEE STANDARDS and its different types.pptx
Introduction to IEEE STANDARDS and its different types.pptx
 
Water Industry Process Automation & Control Monthly - April 2024
Water Industry Process Automation & Control Monthly - April 2024Water Industry Process Automation & Control Monthly - April 2024
Water Industry Process Automation & Control Monthly - April 2024
 
Call Girls Service Nagpur Tanvi Call 7001035870 Meet With Nagpur Escorts
Call Girls Service Nagpur Tanvi Call 7001035870 Meet With Nagpur EscortsCall Girls Service Nagpur Tanvi Call 7001035870 Meet With Nagpur Escorts
Call Girls Service Nagpur Tanvi Call 7001035870 Meet With Nagpur Escorts
 

Pseudocode algorithim flowchart

  • 1. Program Flowchart, Pseudocode & Algorithm development
  • 2. Project 1 Exercise # 8, page 57 Bohl & Rynn’s textbook Due date: February 3rd , 2003 2
  • 3. Learning Objectives Understand the relation between Algorithm and Pseudocode or program flowchart Draw flowcharts Write pseudocodes 3
  • 4. Recall form Class 2 & 3 Use of tools by analyst/programmer in SDLC Design/Programming tools used for: Specifying problem-solving logic 4 Pseudocode: English-language statements that describe the processing steps of a program in paragraph form. START READ EMPLOYEE DATA COMPUTE GROSS PAY COMPUTE DEDUCTIONS COMPUTE NET PAY WRITE EMPLOYEE PAYCHECK STOP Example
  • 5. Algorithm ? Step-by-step procedure to solve a problem An algorithm can be expressed using: A System Flowchart A Program Flowchart A Pseudocode, etc. Any algorithm must meet the following requirements: Use operations from only a given set of basic operations (+,-,/,*,<,>…) 5
  • 6. Example of algorithm (program flowchart) 6 REGSALES = Regular sales amount SALESALES = Reduced sales amount REGCOM = Regular commission (6%) SALESCOM = Sales commission (3%) PAY = Total pay due Algorithm for determining salespersons’ pay I P O
  • 7. Algorithm vocabulary 7 START STOP SYMBOLS NAME Terminal interrupt symbols USE Terminal point (start, stop, or break) Input/Output symbol Reading data from an input medium or writing data to an output medium Process symbol Processing input data
  • 8. Algorithm vocabulary 8 SYMBOLS NAME Flowline symbol USE Sequence of operations and direction of data flow Decision symbol Decision-making operations Predefined-process symbol Operations specified elsewhere (not in the current algorithm)
  • 9. Algorithm vocabulary 9 SYMBOLS NAME Connector symbol USE Exit to, or entry from, another part of the Flowchart Preparation symbol Control operations: Set limit on loop-control variables, Initialize accumulators, etc.
  • 10. Algorithm vocabulary Item Meaning Example Comment 10 Variables Data independence Assignment statement Constant Data items whose values may change, or vary during processing Using Variables instead of their specific values gives a program the capacity to perform processing on any set of input data. Statement that assign a value (calculated or not) to a variable A value that doesn’t change REGCOM = REGSALES *.06 READ REGSALES, SALESALES READ $1000, $3000 .06 1) Variables names are place- holders for values 2) Variable names are chosen by programmer 3) Names should be descriptive The computer will perform the calculation first, and then, assign the result to REGCOM
  • 11. IFTHENELSE / DECISION SYMBOL 11 Is Condition True ? Processing 1 Processing 2 Processing 3 : : : : General form AMOUNT > 200 ? DISCOUNT = AMOUNT * .10 SUBBIL = AMOUNT – DISCOUNT SUBBIL= AMOUNT : : An Example READ AMOUNT YESNO YESNO Could be many processings,… Could be many processings,…
  • 12. Exercise 1: Tuition bill Problem 12 Write the program flowchart to prepare a tuition bill. The input will contain the student name, Social Security Number, and total number of credits for which the student has enrolled. The bill will contain the student name, Social Security Number, and computed tuition. Total credits of 10 or more indicate that the student is full-time. Full-time students pay a flat rate of $1000 for tuition. Total credits of less than 10 indicate that the student is part-time. Part-time students pay $100 per credit for tuition. Exercise 11 (Chapter 3)
  • 13. Exercise 1’s solution: (Part 1: System Flowchart) 13 (To be done in class)
  • 14. Exercise 1 solution: (Part 2: Program Flowchart) 14 (To be done in class)
  • 15. Project 1 15 Write a program flowchart and corresponding pseudocode to solve the following problem: Assume the input for a student is name, student number, and three grades. Output the student name and an S (Success) if the average of the three grades is 65 or more. Otherwise (else), output the student’s name, a U (Unsuccess), and the number of additional points needed for an S.
  • 16. Exercise 2: Billing problem 16 Look at the program flowchart on the next slide, and answer the following questions: (a) For what variables are values read as input ? (b) What variables’ values are output ? (c) What constants are used ? (d) Simulate the execution of this algorithm, assuming the values shown below are read as input for the first four variables named. Exercise 11 (Chapter 2) Blouse 3 49.99 Mrs. A. B. Wallace ITEM QTY PRICE AMTOD DISCOUNT NAME SUBBILL TAXES BILL
  • 17. Exercise 2: Billing problem 17 Exercise 11 (Chapter 2) START READ NAME, ITEM, QTY, PRICE AMTOD = QTY * PRICE DISCOUNT = AMTOD * .10 SUBBILL = AMTOD - DISCOUNT TAXES = SUBBILL * .05 BILL = SUBBILL + TAXES WRITE NAME, ITEM, BILL STOP
  • 18. Exercise 1 solution: Program Flowchart & corresponding Pseudocode 18 READ NAME, SSN, CREDITS WRITE NAME, SSN, TUITION CREDITS ≥ 10 ? TUITION = 1000TUITION = 100 * CREDITS START STOP Start Read NAME, SSN, CREDITS IF CREDITS >= 10 THEN TUITION = 1000 ELSE TUITION = 100 * CREDITS ENDIF Write NAME, SSN, TUITION Stop Pseudocode for Tuition problem NO YES
  • 19. Pseudocode Other common way to represent algorithms Similar to programming languages like Visual Basic but Does not require strict rules as programming languages 19 Start Read NAME, SSN, CREDITS IF CREDITS >= 10 THEN TUITION = 1000 ELSE TUITION = 100 * CREDITS ENDIF Write NAME, SSN, TUITION Stop Pseudocode for Tuition problem (see Slide12) UPPERCASE for variable names UPPERCASE for Reserved words Lowercase for non- reserved words Titlecase
  • 20. Pseudocode 20 Start Read NAME, SSN, CREDITS IF CREDITS >= 10 THEN TUITION = 1000 ELSE TUITION = 100 * CREDITS ENDIF Write NAME, SSN, TUITION Stop Pseudocode for Tuition problem (see Slide12) Use of indentation (i.e. clauses are indented a few positions) for clarity
  • 21. Exercise 3: Weekly Payroll problem 21 Construct a program flowchart and corresponding pseudocode to solve the following problem: ABC company needs a weekly payroll report for its salespeople. Input to the program is a salesperson’s name, number, and weekly sales. Output is the salesperson’s name, number, and pay. Each salesperson receives a base pay of $300 as well as a 10% commission on his or her total sales up to and including $500. Any sales over $500 merit a 15% commission for the employee. (For example, if sales = $600, then pay = $300 + $50 [or .10 * 500] + $15 [.15 * 100] = $350). Use a DOWHILE loop and a counter to compute the weekly payroll for exactly 20 employees. Exercise 19 (Chapter 4)
  • 22. Exercise 3’s solution: (Part 1: System Flowchart) 22 NAME, NUM, SALES WEEKLY PAYROLL PROGRAM NAME, NUM, PAY
  • 23. Algorithm Development Process Design verification, in order to:  Prevent errors from occurring  Detect and correct errors soon Selection of Review Team members for:  Informal design review or  Structured design review Structured Design Review:  Selection of representative values of input (data normally expected, extreme values, invalid data)  Following designed algorithms to determine what output are produce. 23
  • 24. Summary Questions 1. Distinguish between Algorithm on the one hand, and Program flowchart and Pseudocode on the other hand. Discuss the relations between the two. 2. (a) List the main keywords used in Pseudocodes. (b) What control structures they represent. You should know how to design program logic using Program Flowcharts & Pseudocodes (Review Exercises 1,2,3 above & Exercise 15 Ch.4 and answer on page 339) 24