SlideShare una empresa de Scribd logo
1 de 44
Computer Fundamentals: Pradeep K. Sinha & Priti SinhaComputer Fundamentals: Pradeep K. Sinha & Priti Sinha
Slide 1/44Chapter 11: Planning the Computer ProgramRef Page
Computer Fundamentals: Pradeep K. Sinha & Priti SinhaComputer Fundamentals: Pradeep K. Sinha & Priti Sinha
Slide 2/44Chapter 11: Planning the Computer ProgramRef Page
In this chapter you will learn about:
§ Programs must be planned before they are written
§ Algorithm
§ Flowchart
§ Pseudocode
§ Plan the logic of a computer program
§ Commonly used tools for program planning and
their use
Learning ObjectivesLearning Objectives
183
Computer Fundamentals: Pradeep K. Sinha & Priti SinhaComputer Fundamentals: Pradeep K. Sinha & Priti Sinha
Slide 3/44Chapter 11: Planning the Computer ProgramRef Page
Purpose of Program PlanningPurpose of Program Planning
§ To write a correct program, a programmer must write
each and every instruction in the correct sequence
§ Logic (instruction sequence) of a program can be very
complex
§ Hence, programs must be planned before they are
written to ensure program instructions are:
§ Appropriate for the problem
§ In the correct sequence
183
Computer Fundamentals: Pradeep K. Sinha & Priti SinhaComputer Fundamentals: Pradeep K. Sinha & Priti Sinha
Slide 4/44Chapter 11: Planning the Computer ProgramRef Page
AlgorithmAlgorithm
§ Refers to the logic of a program and a step-by-step
description of how to arrive at the solution of a given
problem
§ In order to qualify as an algorithm, a sequence of
instructions must have following characteristics:
§ Each and every instruction should be precise and
unambiguous
§ Each instruction should be such that it can be performed in
a finite time
§ One or more instructions should not be repeated infinitely.
This ensures that the algorithm will ultimately terminate
§ After performing the instructions, that is after the algorithm
terminates, the desired results must be obtained
184
Computer Fundamentals: Pradeep K. Sinha & Priti SinhaComputer Fundamentals: Pradeep K. Sinha & Priti Sinha
Slide 5/44Chapter 11: Planning the Computer ProgramRef Page
Sample Algorithm (Example 1)Sample Algorithm (Example 1)
There are 50 students in a class who appeared in their
final examination. Their mark sheets have been given to
you.
The division column of the mark sheet contains the
division (FIRST, SECOND, THIRD or FAIL) obtained by the
student.
Write an algorithm to calculate and print the total number
of students who passed in FIRST division.
184
Computer Fundamentals: Pradeep K. Sinha & Priti SinhaComputer Fundamentals: Pradeep K. Sinha & Priti Sinha
Slide 6/44Chapter 11: Planning the Computer ProgramRef Page
Step 1: Initialize Total_First_Division and
Total_Marksheets_Checked to zero.
Step 2: Take the mark sheet of the next student.
Step 3: Check the division column of the mark sheet to see if it is
FIRST, if no, go to Step 5.
Step 4: Add 1 to Total_First_Division.
Step 5: Add 1 to Total_Marksheets_Checked.
Step 6: Is Total_Marksheets_Checked = 50, if no, go to Step 2.
Step 7: Print Total_First_Division.
Step 8: Stop.
Sample Algorithm (Example 1)Sample Algorithm (Example 1)
(contd…)
184
Computer Fundamentals: Pradeep K. Sinha & Priti SinhaComputer Fundamentals: Pradeep K. Sinha & Priti Sinha
Slide 7/44Chapter 11: Planning the Computer ProgramRef Page
There are 100 employees in an organization. The organization
wants to distribute annual bonus to the employees based on their
performance. The performance of the employees is recorded in
their annual appraisal forms.
Every employee’s appraisal form contains his/her basic salary and
the grade for his/her performance during the year. The grade is of
three categories – ‘A’ for outstanding performance, ‘B’ for good
performance, and ‘C’ for average performance.
It has been decided that the bonus of an employee will be 100% of
the basic salary for outstanding performance, 70% of the basic
salary for good performance, 40% of the basic salary for average
performance, and zero for all other cases.
Write an algorithm to calculate and print the total bonus amount to
be distributed by the organization.
Sample Algorithm (Example 2)Sample Algorithm (Example 2)
185
Computer Fundamentals: Pradeep K. Sinha & Priti SinhaComputer Fundamentals: Pradeep K. Sinha & Priti Sinha
Slide 8/44Chapter 11: Planning the Computer ProgramRef Page
Step 1: Initialize Total_Bonus and Total_Employees_Checked to zero.
Step 2: Initialize Bonus and Basic_Salary to zero.
Step 3: Take the appraisal form of the next employee.
Step 4: Read the employee’s Basic_Salary and Grade.
Step 5: If Grade = A, then Bonus = Basic_Salary. Go to Step 8.
Step 6: If Grade = B, then Bonus = Basic_Salary x 0.7. Go to Step 8.
Step 7: If Grade = C, then Bonus = Basic_Salary x 0.4.
Step 8: Add Bonus to Total_Bonus.
Step 9: Add 1 to Total_Employees_Checked.
Step 10: If Total_Employees_Checked < 100, then go to Step 2.
Step 11: Print Total_Bonus.
Step 12: Stop.
Sample Algorithm (Example 2)Sample Algorithm (Example 2)
(contd…)
185
Computer Fundamentals: Pradeep K. Sinha & Priti SinhaComputer Fundamentals: Pradeep K. Sinha & Priti Sinha
Slide 9/44Chapter 11: Planning the Computer ProgramRef Page
Representation of AlgorithmsRepresentation of Algorithms
§ As programs
§ As flowcharts
§ As pseudocodes
When an algorithm is represented in the form of a
programming language, it becomes a program
Thus, any program is an algorithm, although the
reverse is not true
185
Computer Fundamentals: Pradeep K. Sinha & Priti SinhaComputer Fundamentals: Pradeep K. Sinha & Priti Sinha
Slide 10/44Chapter 11: Planning the Computer ProgramRef Page
FlowchartFlowchart
§ Flowchart is a pictorial representation of an algorithm
§ Uses symbols (boxes of different shapes) that have
standardized meanings to denote different types of
instructions
§ Actual instructions are written within the boxes
§ Boxes are connected by solid lines having arrow marks to
indicate the exact sequence in which the instructions are
to be executed
§ Process of drawing a flowchart for an algorithm is called
flowcharting
186
Computer Fundamentals: Pradeep K. Sinha & Priti SinhaComputer Fundamentals: Pradeep K. Sinha & Priti Sinha
Slide 11/44Chapter 11: Planning the Computer ProgramRef Page
Basic Flowchart SymbolsBasic Flowchart Symbols
Terminal Processing
Decision
Input/Output
Flow lines Connectors
187
Computer Fundamentals: Pradeep K. Sinha & Priti SinhaComputer Fundamentals: Pradeep K. Sinha & Priti Sinha
Slide 12/44Chapter 11: Planning the Computer ProgramRef Page
Examples of Decision SymbolExamples of Decision Symbol
Is I = 10?
No
Yes
(a) A two-way branch decision. (b) A three-way branch decision.
A > B
A = B
A < B Compare
A & B
188
Computer Fundamentals: Pradeep K. Sinha & Priti SinhaComputer Fundamentals: Pradeep K. Sinha & Priti Sinha
Slide 13/44Chapter 11: Planning the Computer ProgramRef Page
I = ?
(c) A multiple-way branch decision.
= 0 = 1 = 2 = 3 = 4 = 5 = Other
Examples of Decision SymbolExamples of Decision Symbol
(contd…)
188
Computer Fundamentals: Pradeep K. Sinha & Priti SinhaComputer Fundamentals: Pradeep K. Sinha & Priti Sinha
Slide 14/44Chapter 11: Planning the Computer ProgramRef Page
Sample Flowchart (Example 3)Sample Flowchart (Example 3)
A student appears in an examination, which consists of
total 10 subjects, each subject having maximum marks
of 100.
The roll number of the student, his/her name, and the
marks obtained by him/her in various subjects are
supplied as input data.
Such a collection of related data items, which is treated
as a unit is known as a record.
Draw a flowchart for the algorithm to calculate the
percentage marks obtained by the student in this
examination and then to print it along with his/her roll
number and name.
188
Computer Fundamentals: Pradeep K. Sinha & Priti SinhaComputer Fundamentals: Pradeep K. Sinha & Priti Sinha
Slide 15/44Chapter 11: Planning the Computer ProgramRef Page
Start
Read input data
Add marks of all
subjects giving Total
Percentage = Total / 10
Write output data
Stop
Sample Flowchart (Example 3)Sample Flowchart (Example 3)
(contd…)
189
Computer Fundamentals: Pradeep K. Sinha & Priti SinhaComputer Fundamentals: Pradeep K. Sinha & Priti Sinha
Slide 16/44Chapter 11: Planning the Computer ProgramRef Page
50 students of a class appear in the examination of
Example 3.
Draw a flowchart for the algorithm to calculate and print
the percentage marks obtained by each student along
with his/her roll number and name.
Sample Flowchart (Example 4)Sample Flowchart (Example 4)
189
Computer Fundamentals: Pradeep K. Sinha & Priti SinhaComputer Fundamentals: Pradeep K. Sinha & Priti Sinha
Slide 17/44Chapter 11: Planning the Computer ProgramRef Page
Flowchart for the solution
of Example 4 with an
infinite (endless) process
loop.
Start
Add marks of all
subjects giving Total
Percentage = Total / 10
Write output data
Read input data
Sample Flowchart (Example 4)Sample Flowchart (Example 4)
(contd…)
190
Computer Fundamentals: Pradeep K. Sinha & Priti SinhaComputer Fundamentals: Pradeep K. Sinha & Priti Sinha
Slide 18/44Chapter 11: Planning the Computer ProgramRef Page
Flowchart for the solution
of Example 4.
Stop
Start
Read input data
Count = 0
Add marks of all subjects giving Total
Percentage = Total/10
Write output data
Add 1 to Count
Is Count = 50?
No
Yes
Sample Flowchart (Example 4)Sample Flowchart (Example 4)
(contd…)
191
Computer Fundamentals: Pradeep K. Sinha & Priti SinhaComputer Fundamentals: Pradeep K. Sinha & Priti Sinha
Slide 19/44Chapter 11: Planning the Computer ProgramRef Page
Sample Flowchart (Example 4)Sample Flowchart (Example 4)
Generalized flowchart
for the solution of
Example 4 using the
concept of trailer
record. Here the
process loop is
terminated by detecting
a special non-data
record.
Stop
Yes
Start
Add marks of all subjects
giving Total
Percentage = Total / 10
No
Is Rollno = 0000000?
Read input data
Write output data
(contd…)
191
Computer Fundamentals: Pradeep K. Sinha & Priti SinhaComputer Fundamentals: Pradeep K. Sinha & Priti Sinha
Slide 20/44Chapter 11: Planning the Computer ProgramRef Page
For the examination of Example 3, we want to make a
list of only those students who have passed (obtained
30% or more marks) in the examination.
In the end, we also want to print out the total number of
students who have passed.
Assuming that the input data of all the students is
terminated by a trailer record, which has sentinel value
of 9999999 for Rollno, draw a flowchart for the
algorithm to do this.
Sample Flowchart (Example 5)Sample Flowchart (Example 5)
192
Computer Fundamentals: Pradeep K. Sinha & Priti SinhaComputer Fundamentals: Pradeep K. Sinha & Priti Sinha
Slide 21/44Chapter 11: Planning the Computer ProgramRef Page
Is Percentage = > 30?
Percentage = Total/10
Start
Count = 0
Add marks of all subjects giving Total
Is Rollno = 9999999?
No
Yes
Add 1 to Count
Read input data
Write output data
No
Write Count
Stop
Yes
Sample Flowchart (Example 5)Sample Flowchart (Example 5)
(contd…)
193
Computer Fundamentals: Pradeep K. Sinha & Priti SinhaComputer Fundamentals: Pradeep K. Sinha & Priti Sinha
Slide 22/44Chapter 11: Planning the Computer ProgramRef Page
Suppose the input data of each student for the examination of
Example 3 also contains information regarding the sex of the
candidate in the field named Sexcode having values M (for
male) or F (for female).
We want to make a list of only those female students who have
passed in second division (obtained 45% or more but less than
60% marks).
In the end, we also want to print out the total number of such
students.
Assuming that the input data of all the students is terminated
by a trailer record, which has a sentinel value of Z for Sexcode,
draw a flowchart for the algorithm to do this.
Sample Flowchart (Example 6)Sample Flowchart (Example 6)
193
Computer Fundamentals: Pradeep K. Sinha & Priti SinhaComputer Fundamentals: Pradeep K. Sinha & Priti Sinha
Slide 23/44Chapter 11: Planning the Computer ProgramRef Page
Add marks of all subjects giving Total
Yes
Yes
No
Start
Count = 0
No
1
Read input data
Is Sexcode = Z?
Is Sexcode = F?
1
2
Percentage = Total / 10
3
Sample Flowchart (Example 6)Sample Flowchart (Example 6)
195
Computer Fundamentals: Pradeep K. Sinha & Priti SinhaComputer Fundamentals: Pradeep K. Sinha & Priti Sinha
Slide 24/44Chapter 11: Planning the Computer ProgramRef Page
No
No
Yes
Yes
Add 1 to Count
Write output data
Is Percentage < 60?
Is Percentage = > 45?
Stop
Write Count
2
1
1
1
3
Sample Flowchart (Example 4)Sample Flowchart (Example 4)
(contd…)
195
Computer Fundamentals: Pradeep K. Sinha & Priti SinhaComputer Fundamentals: Pradeep K. Sinha & Priti Sinha
Slide 25/44Chapter 11: Planning the Computer ProgramRef Page
Levels of FlowchartLevels of Flowchart
§ Flowchart that outlines the main segments of a program
or that shows less details is a macro flowchart
§ Flowchart with more details is a micro flowchart, or
detailed flowchart
§ There are no set standards on the amount of details that
should be provided in a flowchart
196
Computer Fundamentals: Pradeep K. Sinha & Priti SinhaComputer Fundamentals: Pradeep K. Sinha & Priti Sinha
Slide 26/44Chapter 11: Planning the Computer ProgramRef Page
Example of Micro FlowchartExample of Micro Flowchart
Part of a macro
flowchart
Add marks of all
subjects giving Total
Is I > 10?
1
I = 1
Total = 0
Total = Total + Marks (I)
I = I + 1
1
Yes
No
A micro
Flowchart
196
Computer Fundamentals: Pradeep K. Sinha & Priti SinhaComputer Fundamentals: Pradeep K. Sinha & Priti Sinha
Slide 27/44Chapter 11: Planning the Computer ProgramRef Page
§ First chart the main line of logic, then incorporate detail
§ Maintain a consistent level of detail for a given flowchart
§ Do not chart every detail of the program. A reader who is
interested in greater details can refer to the program itself
§ Words in the flowchart symbols should be common
statements and easy to understand
Flowcharting RulesFlowcharting Rules
196
Computer Fundamentals: Pradeep K. Sinha & Priti SinhaComputer Fundamentals: Pradeep K. Sinha & Priti Sinha
Slide 28/44Chapter 11: Planning the Computer ProgramRef Page
§ Be consistent in using names and variables in the
flowchart
§ Go from left to right and top to bottom in
constructing flowcharts
§ Keep the flowchart as simple as possible. Crossing of
flow lines should be avoided as far as practicable
§ If a new flowcharting page is needed, it is
recommended that the flowchart be broken at an
input or output point.
§ Properly labeled connectors should be used to link
the portions of the flowchart on different pages
(contd…)
Flowcharting RulesFlowcharting Rules
197
Computer Fundamentals: Pradeep K. Sinha & Priti SinhaComputer Fundamentals: Pradeep K. Sinha & Priti Sinha
Slide 29/44Chapter 11: Planning the Computer ProgramRef Page
Advantages of FlowchartAdvantages of Flowchart
§ Better Communication
§ Proper program documentation
§ Efficient coding
§ Systematic debugging
§ Systematic testing
197
Computer Fundamentals: Pradeep K. Sinha & Priti SinhaComputer Fundamentals: Pradeep K. Sinha & Priti Sinha
Slide 30/44Chapter 11: Planning the Computer ProgramRef Page
Limitations of FlowchartLimitations of Flowchart
§ Flowcharts are very time consuming and laborious to
draw (especially for large complex programs)
§ Redrawing a flowchart for incorporating changes/
modifications is a tedious task
§ There are no standards determining the amount of detail
that should be included in a flowchart
198
Computer Fundamentals: Pradeep K. Sinha & Priti SinhaComputer Fundamentals: Pradeep K. Sinha & Priti Sinha
Slide 31/44Chapter 11: Planning the Computer ProgramRef Page
PseudocodePseudocode
§ A program planning tool where program logic is written in
an ordinary natural language using a structure that
resembles computer instructions
§ “ Pseudo” means imitation or false and “ Code” refers to
the instructions written in a programming language.
Hence, pseudocode is an imitation of actual computer
instructions
§ Because it emphasizes the design of the program,
pseudocode is also called Program Design Language
(PDL)
198
Computer Fundamentals: Pradeep K. Sinha & Priti SinhaComputer Fundamentals: Pradeep K. Sinha & Priti Sinha
Slide 32/44Chapter 11: Planning the Computer ProgramRef Page
Basic Logic (Control) StructuresBasic Logic (Control) Structures
Any program logic can be expressed by using only
following three simple logic structures:
1. Sequence logic,
2. Selection logic, and
3. Iteration (or looping) logic
Programs structured by using only these three logic
structures are called structured programs, and the
technique of writing such programs is known as
structured programming
199
Computer Fundamentals: Pradeep K. Sinha & Priti SinhaComputer Fundamentals: Pradeep K. Sinha & Priti Sinha
Slide 33/44Chapter 11: Planning the Computer ProgramRef Page
It is used for performing instructions one after another
in sequence.
Sequence LogicSequence Logic
Process 1
(b) Pseudocode
Process 2
Process 1
Process 2
(a) Flowchart
199
Computer Fundamentals: Pradeep K. Sinha & Priti SinhaComputer Fundamentals: Pradeep K. Sinha & Priti Sinha
Slide 34/44Chapter 11: Planning the Computer ProgramRef Page
Selection LogicSelection Logic
• Also known as decision logic, it is used for making
decisions
• Three popularly used selection logic structures are
1. IF…THEN…ELSE
2. IF…THEN
3. CASE
200
Computer Fundamentals: Pradeep K. Sinha & Priti SinhaComputer Fundamentals: Pradeep K. Sinha & Priti Sinha
Slide 35/44Chapter 11: Planning the Computer ProgramRef Page
Selection Logic (IF…THEN…ELSE Structure)Selection Logic (IF…THEN…ELSE Structure)
THEN
Process 2
IF Condition
Process 1
ELSE
ENDIF
(b) Pseudocode
THEN
Process 1
ELSE
Process 2
Yes No
(a) Flowchart
IF (condition)
200
Computer Fundamentals: Pradeep K. Sinha & Priti SinhaComputer Fundamentals: Pradeep K. Sinha & Priti Sinha
Slide 36/44Chapter 11: Planning the Computer ProgramRef Page
(b) Pseudocode
THEN
IF Condition
Process 1
ENDIF
THEN
Process 1
Yes No
(a) Flowchart
IF (condition)
Selection Logic (IF…THEN Structure)Selection Logic (IF…THEN Structure)
200
Computer Fundamentals: Pradeep K. Sinha & Priti SinhaComputer Fundamentals: Pradeep K. Sinha & Priti Sinha
Slide 37/44Chapter 11: Planning the Computer ProgramRef Page
Selection Logic (CASE Structure)Selection Logic (CASE Structure)
(b) Pseudocode
Case Type 1: Process 1
CASE Type
ENDCASE
Case Type 2: Process 2
Case Type n: Process n
Type 1
Type 2
Type n
Process 2
Process 1
Process n
Yes
Yes
Yes
No
No
No
(a) Flowchart
201
Computer Fundamentals: Pradeep K. Sinha & Priti SinhaComputer Fundamentals: Pradeep K. Sinha & Priti Sinha
Slide 38/44Chapter 11: Planning the Computer ProgramRef Page
Iteration (or Looping) LogicIteration (or Looping) Logic
§ Used to produce loops in program logic when one or
more instructions may be executed several times
depending on some conditions
§ Two popularly used iteration logic structures are
1. DO…WHILE
2. REPEAT…UNTIL
201
Computer Fundamentals: Pradeep K. Sinha & Priti SinhaComputer Fundamentals: Pradeep K. Sinha & Priti Sinha
Slide 39/44Chapter 11: Planning the Computer ProgramRef Page
Iteration (or Looping) Logic
(DO…WHILE Structure)
Iteration (or Looping) Logic
(DO…WHILE Structure)
(b) Pseudocode
DO WHILE Condition
Process 1
ENDDO
Process n
Process 1
False
(a) Flowchart
Process n
True
Condition?
Block
202
Computer Fundamentals: Pradeep K. Sinha & Priti SinhaComputer Fundamentals: Pradeep K. Sinha & Priti Sinha
Slide 40/44Chapter 11: Planning the Computer ProgramRef Page
Iteration (or Looping) Logic
(REPEAT…UNTIL Structure)
Iteration (or Looping) Logic
(REPEAT…UNTIL Structure)
(b) Pseudocode
REPEAT
Process 1
UNTIL Condition
Process n
Process 1
(a) Flowchart
Process n
True
False
Condition?
202
Computer Fundamentals: Pradeep K. Sinha & Priti SinhaComputer Fundamentals: Pradeep K. Sinha & Priti Sinha
Slide 41/44Chapter 11: Planning the Computer ProgramRef Page
Sample Pseudocode (for Example 6)Sample Pseudocode (for Example 6)
Set Count to zero
Read first student record
DO WHILE Sexcode is not equal to Z
IF Sexcode = F THEN
Calculate Percentage
IF Percentage = > 45 THEN
IF Percentage < 60 THEN
Write output data
Add 1 to Count
ENDIF
ENDIF
ENDIF
Read next student record
ENDDO
Write Count
Stop
203
Computer Fundamentals: Pradeep K. Sinha & Priti SinhaComputer Fundamentals: Pradeep K. Sinha & Priti Sinha
Slide 42/44Chapter 11: Planning the Computer ProgramRef Page
Advantages of PseudocodeAdvantages of Pseudocode
§ Converting a pseudocode to a programming language
is much more easier than converting a flowchart to a
programming language
§ As compared to a flowchart, it is easier to modify the
pseudocode of a program logic when program
modifications are necessary
§ Writing of pseudocode involves much less time and
effort than drawing an equivalent flowchart as it has
only a few rules to follow
204
Computer Fundamentals: Pradeep K. Sinha & Priti SinhaComputer Fundamentals: Pradeep K. Sinha & Priti Sinha
Slide 43/44Chapter 11: Planning the Computer ProgramRef Page
Limitations of PseudocodeLimitations of Pseudocode
§ In case of pseudocode, a graphic representation of
program logic is not available
§ There are no standard rules to follow in using
pseudocode
§ Different programmers use their own style of writing
pseudocode and hence communication problem
occurs due to lack of standardization
§ For a beginner, it is more difficult to follow the logic
of or write pseudocode, as compared to flowcharting
204
Computer Fundamentals: Pradeep K. Sinha & Priti SinhaComputer Fundamentals: Pradeep K. Sinha & Priti Sinha
Slide 44/44Chapter 11: Planning the Computer ProgramRef Page
Key Words/PhrasesKey Words/Phrases
§ Algorithm
§ Basic logic structures
§ Control structures
§ Flowchart
§ Iteration logic
§ Looping logic
§ Micro flowchart
§ Macro flowchart
§ Pseudocode
§ Program Design Language (PDL)
§ Sequence logic
§ Selection logic
§ Sentinel value
§ Structured programming
§ Trailer record
204

Más contenido relacionado

La actualidad más candente

What is a flowchart
What is a flowchartWhat is a flowchart
What is a flowchartCLI-IE
 
Linker and Loader Explained
Linker and Loader  ExplainedLinker and Loader  Explained
Linker and Loader ExplainedAdarsh Kr Sinha
 
Pseudocode flowcharts
Pseudocode flowchartsPseudocode flowcharts
Pseudocode flowchartsnicky_walters
 
Types of Statements in Python Programming Language
Types of Statements in Python Programming LanguageTypes of Statements in Python Programming Language
Types of Statements in Python Programming LanguageExplore Skilled
 
Programming Fundamentals lecture 1
Programming Fundamentals lecture 1Programming Fundamentals lecture 1
Programming Fundamentals lecture 1REHAN IJAZ
 
Generation of computer languages
Generation of computer languagesGeneration of computer languages
Generation of computer languageskitturashmikittu
 
Software Engineering ppt
Software Engineering pptSoftware Engineering ppt
Software Engineering pptshruths2890
 
Evolutionary models
Evolutionary modelsEvolutionary models
Evolutionary modelsPihu Goel
 
Algorithm and flowchart
Algorithm and flowchartAlgorithm and flowchart
Algorithm and flowchartRabin BK
 
PRESCRIPTIVE PROCESS MODEL(SOFTWARE ENGINEERING)
PRESCRIPTIVE PROCESS MODEL(SOFTWARE ENGINEERING)PRESCRIPTIVE PROCESS MODEL(SOFTWARE ENGINEERING)
PRESCRIPTIVE PROCESS MODEL(SOFTWARE ENGINEERING)IrtazaAfzal3
 
Introduction to visual basic programming
Introduction to visual basic programmingIntroduction to visual basic programming
Introduction to visual basic programmingRoger Argarin
 

La actualidad más candente (20)

What is a flowchart
What is a flowchartWhat is a flowchart
What is a flowchart
 
Linker and Loader Explained
Linker and Loader  ExplainedLinker and Loader  Explained
Linker and Loader Explained
 
Introduction to Compiler design
Introduction to Compiler design Introduction to Compiler design
Introduction to Compiler design
 
Pseudocode flowcharts
Pseudocode flowchartsPseudocode flowcharts
Pseudocode flowcharts
 
Types of Statements in Python Programming Language
Types of Statements in Python Programming LanguageTypes of Statements in Python Programming Language
Types of Statements in Python Programming Language
 
Compiler design lab programs
Compiler design lab programs Compiler design lab programs
Compiler design lab programs
 
Linker and Loader
Linker and Loader Linker and Loader
Linker and Loader
 
Programming Fundamentals lecture 1
Programming Fundamentals lecture 1Programming Fundamentals lecture 1
Programming Fundamentals lecture 1
 
Generation of computer languages
Generation of computer languagesGeneration of computer languages
Generation of computer languages
 
Lex & yacc
Lex & yaccLex & yacc
Lex & yacc
 
Two pass Assembler
Two pass AssemblerTwo pass Assembler
Two pass Assembler
 
Introduction to problem solving in C
Introduction to problem solving in CIntroduction to problem solving in C
Introduction to problem solving in C
 
Software Engineering ppt
Software Engineering pptSoftware Engineering ppt
Software Engineering ppt
 
Evolutionary models
Evolutionary modelsEvolutionary models
Evolutionary models
 
Python basics
Python basicsPython basics
Python basics
 
Problem solving methodology
Problem solving methodologyProblem solving methodology
Problem solving methodology
 
Algorithm and flowchart
Algorithm and flowchartAlgorithm and flowchart
Algorithm and flowchart
 
PRESCRIPTIVE PROCESS MODEL(SOFTWARE ENGINEERING)
PRESCRIPTIVE PROCESS MODEL(SOFTWARE ENGINEERING)PRESCRIPTIVE PROCESS MODEL(SOFTWARE ENGINEERING)
PRESCRIPTIVE PROCESS MODEL(SOFTWARE ENGINEERING)
 
Pseudocode
PseudocodePseudocode
Pseudocode
 
Introduction to visual basic programming
Introduction to visual basic programmingIntroduction to visual basic programming
Introduction to visual basic programming
 

Destacado

Memory - RAM and its types
Memory - RAM and its typesMemory - RAM and its types
Memory - RAM and its typesAbhay Matthew
 
A practical computer program that diagnoses diseases in actual patients.
A practical computer program that diagnoses diseases in actual patients.A practical computer program that diagnoses diseases in actual patients.
A practical computer program that diagnoses diseases in actual patients.carlos_feder
 
01 intro to internet (re-upload)
01 intro to internet (re-upload)01 intro to internet (re-upload)
01 intro to internet (re-upload)bluejayjunior
 
Chapter 01 introduction to Computer
Chapter 01 introduction to ComputerChapter 01 introduction to Computer
Chapter 01 introduction to ComputerHareem Aslam
 
50 Powerpoint Diagrams, Charts, 3D, Template
50 Powerpoint Diagrams, Charts, 3D, Template50 Powerpoint Diagrams, Charts, 3D, Template
50 Powerpoint Diagrams, Charts, 3D, Templatevolkankeles
 
The solar system
The solar systemThe solar system
The solar systemdough1b
 
TSL061, Computer Literacy - Chapter 01
TSL061, Computer Literacy - Chapter 01TSL061, Computer Literacy - Chapter 01
TSL061, Computer Literacy - Chapter 01Aien Lee
 
Space Chapter 4 Notes
Space Chapter 4 NotesSpace Chapter 4 Notes
Space Chapter 4 NotesMiss Shel
 
Topic 5 Digital Technique basic computer structure
Topic 5 Digital Technique basic computer structureTopic 5 Digital Technique basic computer structure
Topic 5 Digital Technique basic computer structureBai Haqi
 
Computer Graphics Introduction
Computer Graphics IntroductionComputer Graphics Introduction
Computer Graphics IntroductionGhaffar Khan
 
Chapter 01 - Principal Accounting (Warren Reeve Fess)
Chapter 01 - Principal Accounting (Warren Reeve Fess)Chapter 01 - Principal Accounting (Warren Reeve Fess)
Chapter 01 - Principal Accounting (Warren Reeve Fess)Arfan Fahmi
 
Computer storage devices
Computer storage devicesComputer storage devices
Computer storage devicesRizwan Qamar
 
Grade 4 mtap reviewer
Grade 4 mtap reviewerGrade 4 mtap reviewer
Grade 4 mtap reviewerEclud Sugar
 
Discovering Computers: Chapter 01
Discovering Computers: Chapter 01Discovering Computers: Chapter 01
Discovering Computers: Chapter 01Anna Stirling
 

Destacado (20)

Memory - RAM and its types
Memory - RAM and its typesMemory - RAM and its types
Memory - RAM and its types
 
Ram presentation
Ram presentationRam presentation
Ram presentation
 
La memoria ram
La memoria ramLa memoria ram
La memoria ram
 
A practical computer program that diagnoses diseases in actual patients.
A practical computer program that diagnoses diseases in actual patients.A practical computer program that diagnoses diseases in actual patients.
A practical computer program that diagnoses diseases in actual patients.
 
Gaurav ppt
Gaurav pptGaurav ppt
Gaurav ppt
 
Study planning (1)
Study planning (1)Study planning (1)
Study planning (1)
 
01 intro to internet (re-upload)
01 intro to internet (re-upload)01 intro to internet (re-upload)
01 intro to internet (re-upload)
 
Motivation - A story
Motivation - A storyMotivation - A story
Motivation - A story
 
Chapter 01 introduction to Computer
Chapter 01 introduction to ComputerChapter 01 introduction to Computer
Chapter 01 introduction to Computer
 
50 Powerpoint Diagrams, Charts, 3D, Template
50 Powerpoint Diagrams, Charts, 3D, Template50 Powerpoint Diagrams, Charts, 3D, Template
50 Powerpoint Diagrams, Charts, 3D, Template
 
The solar system
The solar systemThe solar system
The solar system
 
TSL061, Computer Literacy - Chapter 01
TSL061, Computer Literacy - Chapter 01TSL061, Computer Literacy - Chapter 01
TSL061, Computer Literacy - Chapter 01
 
Space Chapter 4 Notes
Space Chapter 4 NotesSpace Chapter 4 Notes
Space Chapter 4 Notes
 
Presentation1
Presentation1Presentation1
Presentation1
 
Topic 5 Digital Technique basic computer structure
Topic 5 Digital Technique basic computer structureTopic 5 Digital Technique basic computer structure
Topic 5 Digital Technique basic computer structure
 
Computer Graphics Introduction
Computer Graphics IntroductionComputer Graphics Introduction
Computer Graphics Introduction
 
Chapter 01 - Principal Accounting (Warren Reeve Fess)
Chapter 01 - Principal Accounting (Warren Reeve Fess)Chapter 01 - Principal Accounting (Warren Reeve Fess)
Chapter 01 - Principal Accounting (Warren Reeve Fess)
 
Computer storage devices
Computer storage devicesComputer storage devices
Computer storage devices
 
Grade 4 mtap reviewer
Grade 4 mtap reviewerGrade 4 mtap reviewer
Grade 4 mtap reviewer
 
Discovering Computers: Chapter 01
Discovering Computers: Chapter 01Discovering Computers: Chapter 01
Discovering Computers: Chapter 01
 

Similar a Chapter 01 Planning Computer Program (re-upload)

Chapter 11-PCP.pdf
Chapter 11-PCP.pdfChapter 11-PCP.pdf
Chapter 11-PCP.pdfranapoonam1
 
Computer Fundamentals Chapter 11 pcp
Computer Fundamentals Chapter 11 pcpComputer Fundamentals Chapter 11 pcp
Computer Fundamentals Chapter 11 pcpSaumya Sahu
 
L1. Basic Programming Concepts.pdf
L1. Basic Programming Concepts.pdfL1. Basic Programming Concepts.pdf
L1. Basic Programming Concepts.pdfMMRF2
 
Into to programming fundamentals
Into to programming fundamentalsInto to programming fundamentals
Into to programming fundamentalsAns Ali
 
PDLC.pptx
PDLC.pptxPDLC.pptx
PDLC.pptxmarysj3
 
C Programming Lab manual 18CPL17
C Programming Lab manual 18CPL17C Programming Lab manual 18CPL17
C Programming Lab manual 18CPL17manjurkts
 
Fy secondsemester2016
Fy secondsemester2016Fy secondsemester2016
Fy secondsemester2016Ankit Dubey
 
Fy secondsemester2016
Fy secondsemester2016Fy secondsemester2016
Fy secondsemester2016Ankit Dubey
 
Fy secondsemester2016
Fy secondsemester2016Fy secondsemester2016
Fy secondsemester2016Ankit Dubey
 
CBCS 2018 Scheme I sem Lab Manual for 18CPL17
CBCS 2018 Scheme I sem Lab Manual for 18CPL17 CBCS 2018 Scheme I sem Lab Manual for 18CPL17
CBCS 2018 Scheme I sem Lab Manual for 18CPL17 manjurkts
 
Chapter 05 computer arithmetic 2o-p
Chapter 05 computer arithmetic 2o-pChapter 05 computer arithmetic 2o-p
Chapter 05 computer arithmetic 2o-pIIUI
 
UoN-Lec_12_Control_Structure.pdf
UoN-Lec_12_Control_Structure.pdfUoN-Lec_12_Control_Structure.pdf
UoN-Lec_12_Control_Structure.pdfmadihamaqbool6
 
CC100 Lesson -6B.fnhgmnh,hg,gj.klbcjgjgbg
CC100 Lesson -6B.fnhgmnh,hg,gj.klbcjgjgbgCC100 Lesson -6B.fnhgmnh,hg,gj.klbcjgjgbg
CC100 Lesson -6B.fnhgmnh,hg,gj.klbcjgjgbgmudzabbilani
 
Chapter 05 computer arithmetic
Chapter 05 computer arithmeticChapter 05 computer arithmetic
Chapter 05 computer arithmeticHareem Aslam
 
Chapter 05 computer arithmetic
Chapter 05 computer arithmeticChapter 05 computer arithmetic
Chapter 05 computer arithmeticIIUI
 

Similar a Chapter 01 Planning Computer Program (re-upload) (20)

Chapter 11-PCP.pdf
Chapter 11-PCP.pdfChapter 11-PCP.pdf
Chapter 11-PCP.pdf
 
Computer Fundamentals Chapter 11 pcp
Computer Fundamentals Chapter 11 pcpComputer Fundamentals Chapter 11 pcp
Computer Fundamentals Chapter 11 pcp
 
Unit-I Algorithm.pptx
Unit-I Algorithm.pptxUnit-I Algorithm.pptx
Unit-I Algorithm.pptx
 
Chapter 13 sio
Chapter 13 sioChapter 13 sio
Chapter 13 sio
 
DISE - Programming Concepts
DISE - Programming ConceptsDISE - Programming Concepts
DISE - Programming Concepts
 
L1. Basic Programming Concepts.pdf
L1. Basic Programming Concepts.pdfL1. Basic Programming Concepts.pdf
L1. Basic Programming Concepts.pdf
 
Chapter 15 asp
Chapter 15 aspChapter 15 asp
Chapter 15 asp
 
Into to programming fundamentals
Into to programming fundamentalsInto to programming fundamentals
Into to programming fundamentals
 
PDLC.pptx
PDLC.pptxPDLC.pptx
PDLC.pptx
 
C Programming Lab manual 18CPL17
C Programming Lab manual 18CPL17C Programming Lab manual 18CPL17
C Programming Lab manual 18CPL17
 
Fy secondsemester2016
Fy secondsemester2016Fy secondsemester2016
Fy secondsemester2016
 
Fy secondsemester2016
Fy secondsemester2016Fy secondsemester2016
Fy secondsemester2016
 
Fy secondsemester2016
Fy secondsemester2016Fy secondsemester2016
Fy secondsemester2016
 
CBCS 2018 Scheme I sem Lab Manual for 18CPL17
CBCS 2018 Scheme I sem Lab Manual for 18CPL17 CBCS 2018 Scheme I sem Lab Manual for 18CPL17
CBCS 2018 Scheme I sem Lab Manual for 18CPL17
 
Chapter 05 computer arithmetic 2o-p
Chapter 05 computer arithmetic 2o-pChapter 05 computer arithmetic 2o-p
Chapter 05 computer arithmetic 2o-p
 
UoN-Lec_12_Control_Structure.pdf
UoN-Lec_12_Control_Structure.pdfUoN-Lec_12_Control_Structure.pdf
UoN-Lec_12_Control_Structure.pdf
 
CC100 Lesson -6B.fnhgmnh,hg,gj.klbcjgjgbg
CC100 Lesson -6B.fnhgmnh,hg,gj.klbcjgjgbgCC100 Lesson -6B.fnhgmnh,hg,gj.klbcjgjgbg
CC100 Lesson -6B.fnhgmnh,hg,gj.klbcjgjgbg
 
Chapter 05 computer arithmetic
Chapter 05 computer arithmeticChapter 05 computer arithmetic
Chapter 05 computer arithmetic
 
Chapter 05 computer arithmetic
Chapter 05 computer arithmeticChapter 05 computer arithmetic
Chapter 05 computer arithmetic
 
Programing Fundamental
Programing FundamentalPrograming Fundamental
Programing Fundamental
 

Más de bluejayjunior

Com ed 2 prelim exam
Com ed 2 prelim examCom ed 2 prelim exam
Com ed 2 prelim exambluejayjunior
 
Intr to-html-xhtml-1233508169541646-3
Intr to-html-xhtml-1233508169541646-3Intr to-html-xhtml-1233508169541646-3
Intr to-html-xhtml-1233508169541646-3bluejayjunior
 
Com ed 4 prelim exam
Com ed 4 prelim examCom ed 4 prelim exam
Com ed 4 prelim exambluejayjunior
 
Chapter1.0 database management system
Chapter1.0 database management systemChapter1.0 database management system
Chapter1.0 database management systembluejayjunior
 
01 Database Management (re-uploaded)
01 Database Management (re-uploaded)01 Database Management (re-uploaded)
01 Database Management (re-uploaded)bluejayjunior
 
03 using the internet (re-uploaded)
03 using the internet (re-uploaded)03 using the internet (re-uploaded)
03 using the internet (re-uploaded)bluejayjunior
 
03 using the internet b (re-upload)
03 using the internet b (re-upload)03 using the internet b (re-upload)
03 using the internet b (re-upload)bluejayjunior
 
02 internet history and growth (re-upload)
02 internet history and growth (re-upload)02 internet history and growth (re-upload)
02 internet history and growth (re-upload)bluejayjunior
 
Chapter 02 Computer Languages (re-upload)
Chapter 02 Computer Languages (re-upload)Chapter 02 Computer Languages (re-upload)
Chapter 02 Computer Languages (re-upload)bluejayjunior
 
C++ control structure
C++ control structureC++ control structure
C++ control structurebluejayjunior
 
Joji ilagan career center foundation6final
Joji ilagan career center foundation6finalJoji ilagan career center foundation6final
Joji ilagan career center foundation6finalbluejayjunior
 
reference for finals
reference for finalsreference for finals
reference for finalsbluejayjunior
 
Joji ilagan career center foundation8mid
Joji ilagan career center foundation8midJoji ilagan career center foundation8mid
Joji ilagan career center foundation8midbluejayjunior
 
Joji ilagan career center foundation8pre2
Joji ilagan career center foundation8pre2Joji ilagan career center foundation8pre2
Joji ilagan career center foundation8pre2bluejayjunior
 

Más de bluejayjunior (20)

Com ed 2 prelim exam
Com ed 2 prelim examCom ed 2 prelim exam
Com ed 2 prelim exam
 
Introhtml 2
Introhtml 2Introhtml 2
Introhtml 2
 
Intr to-html-xhtml-1233508169541646-3
Intr to-html-xhtml-1233508169541646-3Intr to-html-xhtml-1233508169541646-3
Intr to-html-xhtml-1233508169541646-3
 
Com ed 4 prelim exam
Com ed 4 prelim examCom ed 4 prelim exam
Com ed 4 prelim exam
 
Chapter1.0 database management system
Chapter1.0 database management systemChapter1.0 database management system
Chapter1.0 database management system
 
01 Database Management (re-uploaded)
01 Database Management (re-uploaded)01 Database Management (re-uploaded)
01 Database Management (re-uploaded)
 
03 using the internet (re-uploaded)
03 using the internet (re-uploaded)03 using the internet (re-uploaded)
03 using the internet (re-uploaded)
 
03 using the internet b (re-upload)
03 using the internet b (re-upload)03 using the internet b (re-upload)
03 using the internet b (re-upload)
 
02 internet history and growth (re-upload)
02 internet history and growth (re-upload)02 internet history and growth (re-upload)
02 internet history and growth (re-upload)
 
Chapter 02 Computer Languages (re-upload)
Chapter 02 Computer Languages (re-upload)Chapter 02 Computer Languages (re-upload)
Chapter 02 Computer Languages (re-upload)
 
C++ control structure
C++ control structureC++ control structure
C++ control structure
 
Joji ilagan career center foundation6final
Joji ilagan career center foundation6finalJoji ilagan career center foundation6final
Joji ilagan career center foundation6final
 
internet security 2
internet security 2internet security 2
internet security 2
 
reference for finals
reference for finalsreference for finals
reference for finals
 
Internet Secutiry
Internet SecutiryInternet Secutiry
Internet Secutiry
 
Com Ed 8 Finals
Com Ed 8 FinalsCom Ed 8 Finals
Com Ed 8 Finals
 
Joji ilagan career center foundation8mid
Joji ilagan career center foundation8midJoji ilagan career center foundation8mid
Joji ilagan career center foundation8mid
 
00 Com Ed 6 Midterm
00 Com Ed 6 Midterm00 Com Ed 6 Midterm
00 Com Ed 6 Midterm
 
Joji ilagan career center foundation8pre2
Joji ilagan career center foundation8pre2Joji ilagan career center foundation8pre2
Joji ilagan career center foundation8pre2
 
Com Ed 6 Prelim
Com Ed 6 PrelimCom Ed 6 Prelim
Com Ed 6 Prelim
 

Último

Graduate Outcomes Presentation Slides - English
Graduate Outcomes Presentation Slides - EnglishGraduate Outcomes Presentation Slides - English
Graduate Outcomes Presentation Slides - Englishneillewis46
 
Interdisciplinary_Insights_Data_Collection_Methods.pptx
Interdisciplinary_Insights_Data_Collection_Methods.pptxInterdisciplinary_Insights_Data_Collection_Methods.pptx
Interdisciplinary_Insights_Data_Collection_Methods.pptxPooja Bhuva
 
ICT Role in 21st Century Education & its Challenges.pptx
ICT Role in 21st Century Education & its Challenges.pptxICT Role in 21st Century Education & its Challenges.pptx
ICT Role in 21st Century Education & its Challenges.pptxAreebaZafar22
 
Basic Civil Engineering first year Notes- Chapter 4 Building.pptx
Basic Civil Engineering first year Notes- Chapter 4 Building.pptxBasic Civil Engineering first year Notes- Chapter 4 Building.pptx
Basic Civil Engineering first year Notes- Chapter 4 Building.pptxDenish Jangid
 
Single or Multiple melodic lines structure
Single or Multiple melodic lines structureSingle or Multiple melodic lines structure
Single or Multiple melodic lines structuredhanjurrannsibayan2
 
Sociology 101 Demonstration of Learning Exhibit
Sociology 101 Demonstration of Learning ExhibitSociology 101 Demonstration of Learning Exhibit
Sociology 101 Demonstration of Learning Exhibitjbellavia9
 
Sensory_Experience_and_Emotional_Resonance_in_Gabriel_Okaras_The_Piano_and_Th...
Sensory_Experience_and_Emotional_Resonance_in_Gabriel_Okaras_The_Piano_and_Th...Sensory_Experience_and_Emotional_Resonance_in_Gabriel_Okaras_The_Piano_and_Th...
Sensory_Experience_and_Emotional_Resonance_in_Gabriel_Okaras_The_Piano_and_Th...Pooja Bhuva
 
Python Notes for mca i year students osmania university.docx
Python Notes for mca i year students osmania university.docxPython Notes for mca i year students osmania university.docx
Python Notes for mca i year students osmania university.docxRamakrishna Reddy Bijjam
 
Google Gemini An AI Revolution in Education.pptx
Google Gemini An AI Revolution in Education.pptxGoogle Gemini An AI Revolution in Education.pptx
Google Gemini An AI Revolution in Education.pptxDr. Sarita Anand
 
How to Create and Manage Wizard in Odoo 17
How to Create and Manage Wizard in Odoo 17How to Create and Manage Wizard in Odoo 17
How to Create and Manage Wizard in Odoo 17Celine George
 
Key note speaker Neum_Admir Softic_ENG.pdf
Key note speaker Neum_Admir Softic_ENG.pdfKey note speaker Neum_Admir Softic_ENG.pdf
Key note speaker Neum_Admir Softic_ENG.pdfAdmir Softic
 
NO1 Top Black Magic Specialist In Lahore Black magic In Pakistan Kala Ilam Ex...
NO1 Top Black Magic Specialist In Lahore Black magic In Pakistan Kala Ilam Ex...NO1 Top Black Magic Specialist In Lahore Black magic In Pakistan Kala Ilam Ex...
NO1 Top Black Magic Specialist In Lahore Black magic In Pakistan Kala Ilam Ex...Amil baba
 
HMCS Max Bernays Pre-Deployment Brief (May 2024).pptx
HMCS Max Bernays Pre-Deployment Brief (May 2024).pptxHMCS Max Bernays Pre-Deployment Brief (May 2024).pptx
HMCS Max Bernays Pre-Deployment Brief (May 2024).pptxEsquimalt MFRC
 
This PowerPoint helps students to consider the concept of infinity.
This PowerPoint helps students to consider the concept of infinity.This PowerPoint helps students to consider the concept of infinity.
This PowerPoint helps students to consider the concept of infinity.christianmathematics
 
REMIFENTANIL: An Ultra short acting opioid.pptx
REMIFENTANIL: An Ultra short acting opioid.pptxREMIFENTANIL: An Ultra short acting opioid.pptx
REMIFENTANIL: An Ultra short acting opioid.pptxDr. Ravikiran H M Gowda
 
FSB Advising Checklist - Orientation 2024
FSB Advising Checklist - Orientation 2024FSB Advising Checklist - Orientation 2024
FSB Advising Checklist - Orientation 2024Elizabeth Walsh
 
Jual Obat Aborsi Hongkong ( Asli No.1 ) 085657271886 Obat Penggugur Kandungan...
Jual Obat Aborsi Hongkong ( Asli No.1 ) 085657271886 Obat Penggugur Kandungan...Jual Obat Aborsi Hongkong ( Asli No.1 ) 085657271886 Obat Penggugur Kandungan...
Jual Obat Aborsi Hongkong ( Asli No.1 ) 085657271886 Obat Penggugur Kandungan...ZurliaSoop
 
How to Give a Domain for a Field in Odoo 17
How to Give a Domain for a Field in Odoo 17How to Give a Domain for a Field in Odoo 17
How to Give a Domain for a Field in Odoo 17Celine George
 
TỔNG ÔN TẬP THI VÀO LỚP 10 MÔN TIẾNG ANH NĂM HỌC 2023 - 2024 CÓ ĐÁP ÁN (NGỮ Â...
TỔNG ÔN TẬP THI VÀO LỚP 10 MÔN TIẾNG ANH NĂM HỌC 2023 - 2024 CÓ ĐÁP ÁN (NGỮ Â...TỔNG ÔN TẬP THI VÀO LỚP 10 MÔN TIẾNG ANH NĂM HỌC 2023 - 2024 CÓ ĐÁP ÁN (NGỮ Â...
TỔNG ÔN TẬP THI VÀO LỚP 10 MÔN TIẾNG ANH NĂM HỌC 2023 - 2024 CÓ ĐÁP ÁN (NGỮ Â...Nguyen Thanh Tu Collection
 
Micro-Scholarship, What it is, How can it help me.pdf
Micro-Scholarship, What it is, How can it help me.pdfMicro-Scholarship, What it is, How can it help me.pdf
Micro-Scholarship, What it is, How can it help me.pdfPoh-Sun Goh
 

Último (20)

Graduate Outcomes Presentation Slides - English
Graduate Outcomes Presentation Slides - EnglishGraduate Outcomes Presentation Slides - English
Graduate Outcomes Presentation Slides - English
 
Interdisciplinary_Insights_Data_Collection_Methods.pptx
Interdisciplinary_Insights_Data_Collection_Methods.pptxInterdisciplinary_Insights_Data_Collection_Methods.pptx
Interdisciplinary_Insights_Data_Collection_Methods.pptx
 
ICT Role in 21st Century Education & its Challenges.pptx
ICT Role in 21st Century Education & its Challenges.pptxICT Role in 21st Century Education & its Challenges.pptx
ICT Role in 21st Century Education & its Challenges.pptx
 
Basic Civil Engineering first year Notes- Chapter 4 Building.pptx
Basic Civil Engineering first year Notes- Chapter 4 Building.pptxBasic Civil Engineering first year Notes- Chapter 4 Building.pptx
Basic Civil Engineering first year Notes- Chapter 4 Building.pptx
 
Single or Multiple melodic lines structure
Single or Multiple melodic lines structureSingle or Multiple melodic lines structure
Single or Multiple melodic lines structure
 
Sociology 101 Demonstration of Learning Exhibit
Sociology 101 Demonstration of Learning ExhibitSociology 101 Demonstration of Learning Exhibit
Sociology 101 Demonstration of Learning Exhibit
 
Sensory_Experience_and_Emotional_Resonance_in_Gabriel_Okaras_The_Piano_and_Th...
Sensory_Experience_and_Emotional_Resonance_in_Gabriel_Okaras_The_Piano_and_Th...Sensory_Experience_and_Emotional_Resonance_in_Gabriel_Okaras_The_Piano_and_Th...
Sensory_Experience_and_Emotional_Resonance_in_Gabriel_Okaras_The_Piano_and_Th...
 
Python Notes for mca i year students osmania university.docx
Python Notes for mca i year students osmania university.docxPython Notes for mca i year students osmania university.docx
Python Notes for mca i year students osmania university.docx
 
Google Gemini An AI Revolution in Education.pptx
Google Gemini An AI Revolution in Education.pptxGoogle Gemini An AI Revolution in Education.pptx
Google Gemini An AI Revolution in Education.pptx
 
How to Create and Manage Wizard in Odoo 17
How to Create and Manage Wizard in Odoo 17How to Create and Manage Wizard in Odoo 17
How to Create and Manage Wizard in Odoo 17
 
Key note speaker Neum_Admir Softic_ENG.pdf
Key note speaker Neum_Admir Softic_ENG.pdfKey note speaker Neum_Admir Softic_ENG.pdf
Key note speaker Neum_Admir Softic_ENG.pdf
 
NO1 Top Black Magic Specialist In Lahore Black magic In Pakistan Kala Ilam Ex...
NO1 Top Black Magic Specialist In Lahore Black magic In Pakistan Kala Ilam Ex...NO1 Top Black Magic Specialist In Lahore Black magic In Pakistan Kala Ilam Ex...
NO1 Top Black Magic Specialist In Lahore Black magic In Pakistan Kala Ilam Ex...
 
HMCS Max Bernays Pre-Deployment Brief (May 2024).pptx
HMCS Max Bernays Pre-Deployment Brief (May 2024).pptxHMCS Max Bernays Pre-Deployment Brief (May 2024).pptx
HMCS Max Bernays Pre-Deployment Brief (May 2024).pptx
 
This PowerPoint helps students to consider the concept of infinity.
This PowerPoint helps students to consider the concept of infinity.This PowerPoint helps students to consider the concept of infinity.
This PowerPoint helps students to consider the concept of infinity.
 
REMIFENTANIL: An Ultra short acting opioid.pptx
REMIFENTANIL: An Ultra short acting opioid.pptxREMIFENTANIL: An Ultra short acting opioid.pptx
REMIFENTANIL: An Ultra short acting opioid.pptx
 
FSB Advising Checklist - Orientation 2024
FSB Advising Checklist - Orientation 2024FSB Advising Checklist - Orientation 2024
FSB Advising Checklist - Orientation 2024
 
Jual Obat Aborsi Hongkong ( Asli No.1 ) 085657271886 Obat Penggugur Kandungan...
Jual Obat Aborsi Hongkong ( Asli No.1 ) 085657271886 Obat Penggugur Kandungan...Jual Obat Aborsi Hongkong ( Asli No.1 ) 085657271886 Obat Penggugur Kandungan...
Jual Obat Aborsi Hongkong ( Asli No.1 ) 085657271886 Obat Penggugur Kandungan...
 
How to Give a Domain for a Field in Odoo 17
How to Give a Domain for a Field in Odoo 17How to Give a Domain for a Field in Odoo 17
How to Give a Domain for a Field in Odoo 17
 
TỔNG ÔN TẬP THI VÀO LỚP 10 MÔN TIẾNG ANH NĂM HỌC 2023 - 2024 CÓ ĐÁP ÁN (NGỮ Â...
TỔNG ÔN TẬP THI VÀO LỚP 10 MÔN TIẾNG ANH NĂM HỌC 2023 - 2024 CÓ ĐÁP ÁN (NGỮ Â...TỔNG ÔN TẬP THI VÀO LỚP 10 MÔN TIẾNG ANH NĂM HỌC 2023 - 2024 CÓ ĐÁP ÁN (NGỮ Â...
TỔNG ÔN TẬP THI VÀO LỚP 10 MÔN TIẾNG ANH NĂM HỌC 2023 - 2024 CÓ ĐÁP ÁN (NGỮ Â...
 
Micro-Scholarship, What it is, How can it help me.pdf
Micro-Scholarship, What it is, How can it help me.pdfMicro-Scholarship, What it is, How can it help me.pdf
Micro-Scholarship, What it is, How can it help me.pdf
 

Chapter 01 Planning Computer Program (re-upload)

  • 1. Computer Fundamentals: Pradeep K. Sinha & Priti SinhaComputer Fundamentals: Pradeep K. Sinha & Priti Sinha Slide 1/44Chapter 11: Planning the Computer ProgramRef Page
  • 2. Computer Fundamentals: Pradeep K. Sinha & Priti SinhaComputer Fundamentals: Pradeep K. Sinha & Priti Sinha Slide 2/44Chapter 11: Planning the Computer ProgramRef Page In this chapter you will learn about: § Programs must be planned before they are written § Algorithm § Flowchart § Pseudocode § Plan the logic of a computer program § Commonly used tools for program planning and their use Learning ObjectivesLearning Objectives 183
  • 3. Computer Fundamentals: Pradeep K. Sinha & Priti SinhaComputer Fundamentals: Pradeep K. Sinha & Priti Sinha Slide 3/44Chapter 11: Planning the Computer ProgramRef Page Purpose of Program PlanningPurpose of Program Planning § To write a correct program, a programmer must write each and every instruction in the correct sequence § Logic (instruction sequence) of a program can be very complex § Hence, programs must be planned before they are written to ensure program instructions are: § Appropriate for the problem § In the correct sequence 183
  • 4. Computer Fundamentals: Pradeep K. Sinha & Priti SinhaComputer Fundamentals: Pradeep K. Sinha & Priti Sinha Slide 4/44Chapter 11: Planning the Computer ProgramRef Page AlgorithmAlgorithm § Refers to the logic of a program and a step-by-step description of how to arrive at the solution of a given problem § In order to qualify as an algorithm, a sequence of instructions must have following characteristics: § Each and every instruction should be precise and unambiguous § Each instruction should be such that it can be performed in a finite time § One or more instructions should not be repeated infinitely. This ensures that the algorithm will ultimately terminate § After performing the instructions, that is after the algorithm terminates, the desired results must be obtained 184
  • 5. Computer Fundamentals: Pradeep K. Sinha & Priti SinhaComputer Fundamentals: Pradeep K. Sinha & Priti Sinha Slide 5/44Chapter 11: Planning the Computer ProgramRef Page Sample Algorithm (Example 1)Sample Algorithm (Example 1) There are 50 students in a class who appeared in their final examination. Their mark sheets have been given to you. The division column of the mark sheet contains the division (FIRST, SECOND, THIRD or FAIL) obtained by the student. Write an algorithm to calculate and print the total number of students who passed in FIRST division. 184
  • 6. Computer Fundamentals: Pradeep K. Sinha & Priti SinhaComputer Fundamentals: Pradeep K. Sinha & Priti Sinha Slide 6/44Chapter 11: Planning the Computer ProgramRef Page Step 1: Initialize Total_First_Division and Total_Marksheets_Checked to zero. Step 2: Take the mark sheet of the next student. Step 3: Check the division column of the mark sheet to see if it is FIRST, if no, go to Step 5. Step 4: Add 1 to Total_First_Division. Step 5: Add 1 to Total_Marksheets_Checked. Step 6: Is Total_Marksheets_Checked = 50, if no, go to Step 2. Step 7: Print Total_First_Division. Step 8: Stop. Sample Algorithm (Example 1)Sample Algorithm (Example 1) (contd…) 184
  • 7. Computer Fundamentals: Pradeep K. Sinha & Priti SinhaComputer Fundamentals: Pradeep K. Sinha & Priti Sinha Slide 7/44Chapter 11: Planning the Computer ProgramRef Page There are 100 employees in an organization. The organization wants to distribute annual bonus to the employees based on their performance. The performance of the employees is recorded in their annual appraisal forms. Every employee’s appraisal form contains his/her basic salary and the grade for his/her performance during the year. The grade is of three categories – ‘A’ for outstanding performance, ‘B’ for good performance, and ‘C’ for average performance. It has been decided that the bonus of an employee will be 100% of the basic salary for outstanding performance, 70% of the basic salary for good performance, 40% of the basic salary for average performance, and zero for all other cases. Write an algorithm to calculate and print the total bonus amount to be distributed by the organization. Sample Algorithm (Example 2)Sample Algorithm (Example 2) 185
  • 8. Computer Fundamentals: Pradeep K. Sinha & Priti SinhaComputer Fundamentals: Pradeep K. Sinha & Priti Sinha Slide 8/44Chapter 11: Planning the Computer ProgramRef Page Step 1: Initialize Total_Bonus and Total_Employees_Checked to zero. Step 2: Initialize Bonus and Basic_Salary to zero. Step 3: Take the appraisal form of the next employee. Step 4: Read the employee’s Basic_Salary and Grade. Step 5: If Grade = A, then Bonus = Basic_Salary. Go to Step 8. Step 6: If Grade = B, then Bonus = Basic_Salary x 0.7. Go to Step 8. Step 7: If Grade = C, then Bonus = Basic_Salary x 0.4. Step 8: Add Bonus to Total_Bonus. Step 9: Add 1 to Total_Employees_Checked. Step 10: If Total_Employees_Checked < 100, then go to Step 2. Step 11: Print Total_Bonus. Step 12: Stop. Sample Algorithm (Example 2)Sample Algorithm (Example 2) (contd…) 185
  • 9. Computer Fundamentals: Pradeep K. Sinha & Priti SinhaComputer Fundamentals: Pradeep K. Sinha & Priti Sinha Slide 9/44Chapter 11: Planning the Computer ProgramRef Page Representation of AlgorithmsRepresentation of Algorithms § As programs § As flowcharts § As pseudocodes When an algorithm is represented in the form of a programming language, it becomes a program Thus, any program is an algorithm, although the reverse is not true 185
  • 10. Computer Fundamentals: Pradeep K. Sinha & Priti SinhaComputer Fundamentals: Pradeep K. Sinha & Priti Sinha Slide 10/44Chapter 11: Planning the Computer ProgramRef Page FlowchartFlowchart § Flowchart is a pictorial representation of an algorithm § Uses symbols (boxes of different shapes) that have standardized meanings to denote different types of instructions § Actual instructions are written within the boxes § Boxes are connected by solid lines having arrow marks to indicate the exact sequence in which the instructions are to be executed § Process of drawing a flowchart for an algorithm is called flowcharting 186
  • 11. Computer Fundamentals: Pradeep K. Sinha & Priti SinhaComputer Fundamentals: Pradeep K. Sinha & Priti Sinha Slide 11/44Chapter 11: Planning the Computer ProgramRef Page Basic Flowchart SymbolsBasic Flowchart Symbols Terminal Processing Decision Input/Output Flow lines Connectors 187
  • 12. Computer Fundamentals: Pradeep K. Sinha & Priti SinhaComputer Fundamentals: Pradeep K. Sinha & Priti Sinha Slide 12/44Chapter 11: Planning the Computer ProgramRef Page Examples of Decision SymbolExamples of Decision Symbol Is I = 10? No Yes (a) A two-way branch decision. (b) A three-way branch decision. A > B A = B A < B Compare A & B 188
  • 13. Computer Fundamentals: Pradeep K. Sinha & Priti SinhaComputer Fundamentals: Pradeep K. Sinha & Priti Sinha Slide 13/44Chapter 11: Planning the Computer ProgramRef Page I = ? (c) A multiple-way branch decision. = 0 = 1 = 2 = 3 = 4 = 5 = Other Examples of Decision SymbolExamples of Decision Symbol (contd…) 188
  • 14. Computer Fundamentals: Pradeep K. Sinha & Priti SinhaComputer Fundamentals: Pradeep K. Sinha & Priti Sinha Slide 14/44Chapter 11: Planning the Computer ProgramRef Page Sample Flowchart (Example 3)Sample Flowchart (Example 3) A student appears in an examination, which consists of total 10 subjects, each subject having maximum marks of 100. The roll number of the student, his/her name, and the marks obtained by him/her in various subjects are supplied as input data. Such a collection of related data items, which is treated as a unit is known as a record. Draw a flowchart for the algorithm to calculate the percentage marks obtained by the student in this examination and then to print it along with his/her roll number and name. 188
  • 15. Computer Fundamentals: Pradeep K. Sinha & Priti SinhaComputer Fundamentals: Pradeep K. Sinha & Priti Sinha Slide 15/44Chapter 11: Planning the Computer ProgramRef Page Start Read input data Add marks of all subjects giving Total Percentage = Total / 10 Write output data Stop Sample Flowchart (Example 3)Sample Flowchart (Example 3) (contd…) 189
  • 16. Computer Fundamentals: Pradeep K. Sinha & Priti SinhaComputer Fundamentals: Pradeep K. Sinha & Priti Sinha Slide 16/44Chapter 11: Planning the Computer ProgramRef Page 50 students of a class appear in the examination of Example 3. Draw a flowchart for the algorithm to calculate and print the percentage marks obtained by each student along with his/her roll number and name. Sample Flowchart (Example 4)Sample Flowchart (Example 4) 189
  • 17. Computer Fundamentals: Pradeep K. Sinha & Priti SinhaComputer Fundamentals: Pradeep K. Sinha & Priti Sinha Slide 17/44Chapter 11: Planning the Computer ProgramRef Page Flowchart for the solution of Example 4 with an infinite (endless) process loop. Start Add marks of all subjects giving Total Percentage = Total / 10 Write output data Read input data Sample Flowchart (Example 4)Sample Flowchart (Example 4) (contd…) 190
  • 18. Computer Fundamentals: Pradeep K. Sinha & Priti SinhaComputer Fundamentals: Pradeep K. Sinha & Priti Sinha Slide 18/44Chapter 11: Planning the Computer ProgramRef Page Flowchart for the solution of Example 4. Stop Start Read input data Count = 0 Add marks of all subjects giving Total Percentage = Total/10 Write output data Add 1 to Count Is Count = 50? No Yes Sample Flowchart (Example 4)Sample Flowchart (Example 4) (contd…) 191
  • 19. Computer Fundamentals: Pradeep K. Sinha & Priti SinhaComputer Fundamentals: Pradeep K. Sinha & Priti Sinha Slide 19/44Chapter 11: Planning the Computer ProgramRef Page Sample Flowchart (Example 4)Sample Flowchart (Example 4) Generalized flowchart for the solution of Example 4 using the concept of trailer record. Here the process loop is terminated by detecting a special non-data record. Stop Yes Start Add marks of all subjects giving Total Percentage = Total / 10 No Is Rollno = 0000000? Read input data Write output data (contd…) 191
  • 20. Computer Fundamentals: Pradeep K. Sinha & Priti SinhaComputer Fundamentals: Pradeep K. Sinha & Priti Sinha Slide 20/44Chapter 11: Planning the Computer ProgramRef Page For the examination of Example 3, we want to make a list of only those students who have passed (obtained 30% or more marks) in the examination. In the end, we also want to print out the total number of students who have passed. Assuming that the input data of all the students is terminated by a trailer record, which has sentinel value of 9999999 for Rollno, draw a flowchart for the algorithm to do this. Sample Flowchart (Example 5)Sample Flowchart (Example 5) 192
  • 21. Computer Fundamentals: Pradeep K. Sinha & Priti SinhaComputer Fundamentals: Pradeep K. Sinha & Priti Sinha Slide 21/44Chapter 11: Planning the Computer ProgramRef Page Is Percentage = > 30? Percentage = Total/10 Start Count = 0 Add marks of all subjects giving Total Is Rollno = 9999999? No Yes Add 1 to Count Read input data Write output data No Write Count Stop Yes Sample Flowchart (Example 5)Sample Flowchart (Example 5) (contd…) 193
  • 22. Computer Fundamentals: Pradeep K. Sinha & Priti SinhaComputer Fundamentals: Pradeep K. Sinha & Priti Sinha Slide 22/44Chapter 11: Planning the Computer ProgramRef Page Suppose the input data of each student for the examination of Example 3 also contains information regarding the sex of the candidate in the field named Sexcode having values M (for male) or F (for female). We want to make a list of only those female students who have passed in second division (obtained 45% or more but less than 60% marks). In the end, we also want to print out the total number of such students. Assuming that the input data of all the students is terminated by a trailer record, which has a sentinel value of Z for Sexcode, draw a flowchart for the algorithm to do this. Sample Flowchart (Example 6)Sample Flowchart (Example 6) 193
  • 23. Computer Fundamentals: Pradeep K. Sinha & Priti SinhaComputer Fundamentals: Pradeep K. Sinha & Priti Sinha Slide 23/44Chapter 11: Planning the Computer ProgramRef Page Add marks of all subjects giving Total Yes Yes No Start Count = 0 No 1 Read input data Is Sexcode = Z? Is Sexcode = F? 1 2 Percentage = Total / 10 3 Sample Flowchart (Example 6)Sample Flowchart (Example 6) 195
  • 24. Computer Fundamentals: Pradeep K. Sinha & Priti SinhaComputer Fundamentals: Pradeep K. Sinha & Priti Sinha Slide 24/44Chapter 11: Planning the Computer ProgramRef Page No No Yes Yes Add 1 to Count Write output data Is Percentage < 60? Is Percentage = > 45? Stop Write Count 2 1 1 1 3 Sample Flowchart (Example 4)Sample Flowchart (Example 4) (contd…) 195
  • 25. Computer Fundamentals: Pradeep K. Sinha & Priti SinhaComputer Fundamentals: Pradeep K. Sinha & Priti Sinha Slide 25/44Chapter 11: Planning the Computer ProgramRef Page Levels of FlowchartLevels of Flowchart § Flowchart that outlines the main segments of a program or that shows less details is a macro flowchart § Flowchart with more details is a micro flowchart, or detailed flowchart § There are no set standards on the amount of details that should be provided in a flowchart 196
  • 26. Computer Fundamentals: Pradeep K. Sinha & Priti SinhaComputer Fundamentals: Pradeep K. Sinha & Priti Sinha Slide 26/44Chapter 11: Planning the Computer ProgramRef Page Example of Micro FlowchartExample of Micro Flowchart Part of a macro flowchart Add marks of all subjects giving Total Is I > 10? 1 I = 1 Total = 0 Total = Total + Marks (I) I = I + 1 1 Yes No A micro Flowchart 196
  • 27. Computer Fundamentals: Pradeep K. Sinha & Priti SinhaComputer Fundamentals: Pradeep K. Sinha & Priti Sinha Slide 27/44Chapter 11: Planning the Computer ProgramRef Page § First chart the main line of logic, then incorporate detail § Maintain a consistent level of detail for a given flowchart § Do not chart every detail of the program. A reader who is interested in greater details can refer to the program itself § Words in the flowchart symbols should be common statements and easy to understand Flowcharting RulesFlowcharting Rules 196
  • 28. Computer Fundamentals: Pradeep K. Sinha & Priti SinhaComputer Fundamentals: Pradeep K. Sinha & Priti Sinha Slide 28/44Chapter 11: Planning the Computer ProgramRef Page § Be consistent in using names and variables in the flowchart § Go from left to right and top to bottom in constructing flowcharts § Keep the flowchart as simple as possible. Crossing of flow lines should be avoided as far as practicable § If a new flowcharting page is needed, it is recommended that the flowchart be broken at an input or output point. § Properly labeled connectors should be used to link the portions of the flowchart on different pages (contd…) Flowcharting RulesFlowcharting Rules 197
  • 29. Computer Fundamentals: Pradeep K. Sinha & Priti SinhaComputer Fundamentals: Pradeep K. Sinha & Priti Sinha Slide 29/44Chapter 11: Planning the Computer ProgramRef Page Advantages of FlowchartAdvantages of Flowchart § Better Communication § Proper program documentation § Efficient coding § Systematic debugging § Systematic testing 197
  • 30. Computer Fundamentals: Pradeep K. Sinha & Priti SinhaComputer Fundamentals: Pradeep K. Sinha & Priti Sinha Slide 30/44Chapter 11: Planning the Computer ProgramRef Page Limitations of FlowchartLimitations of Flowchart § Flowcharts are very time consuming and laborious to draw (especially for large complex programs) § Redrawing a flowchart for incorporating changes/ modifications is a tedious task § There are no standards determining the amount of detail that should be included in a flowchart 198
  • 31. Computer Fundamentals: Pradeep K. Sinha & Priti SinhaComputer Fundamentals: Pradeep K. Sinha & Priti Sinha Slide 31/44Chapter 11: Planning the Computer ProgramRef Page PseudocodePseudocode § A program planning tool where program logic is written in an ordinary natural language using a structure that resembles computer instructions § “ Pseudo” means imitation or false and “ Code” refers to the instructions written in a programming language. Hence, pseudocode is an imitation of actual computer instructions § Because it emphasizes the design of the program, pseudocode is also called Program Design Language (PDL) 198
  • 32. Computer Fundamentals: Pradeep K. Sinha & Priti SinhaComputer Fundamentals: Pradeep K. Sinha & Priti Sinha Slide 32/44Chapter 11: Planning the Computer ProgramRef Page Basic Logic (Control) StructuresBasic Logic (Control) Structures Any program logic can be expressed by using only following three simple logic structures: 1. Sequence logic, 2. Selection logic, and 3. Iteration (or looping) logic Programs structured by using only these three logic structures are called structured programs, and the technique of writing such programs is known as structured programming 199
  • 33. Computer Fundamentals: Pradeep K. Sinha & Priti SinhaComputer Fundamentals: Pradeep K. Sinha & Priti Sinha Slide 33/44Chapter 11: Planning the Computer ProgramRef Page It is used for performing instructions one after another in sequence. Sequence LogicSequence Logic Process 1 (b) Pseudocode Process 2 Process 1 Process 2 (a) Flowchart 199
  • 34. Computer Fundamentals: Pradeep K. Sinha & Priti SinhaComputer Fundamentals: Pradeep K. Sinha & Priti Sinha Slide 34/44Chapter 11: Planning the Computer ProgramRef Page Selection LogicSelection Logic • Also known as decision logic, it is used for making decisions • Three popularly used selection logic structures are 1. IF…THEN…ELSE 2. IF…THEN 3. CASE 200
  • 35. Computer Fundamentals: Pradeep K. Sinha & Priti SinhaComputer Fundamentals: Pradeep K. Sinha & Priti Sinha Slide 35/44Chapter 11: Planning the Computer ProgramRef Page Selection Logic (IF…THEN…ELSE Structure)Selection Logic (IF…THEN…ELSE Structure) THEN Process 2 IF Condition Process 1 ELSE ENDIF (b) Pseudocode THEN Process 1 ELSE Process 2 Yes No (a) Flowchart IF (condition) 200
  • 36. Computer Fundamentals: Pradeep K. Sinha & Priti SinhaComputer Fundamentals: Pradeep K. Sinha & Priti Sinha Slide 36/44Chapter 11: Planning the Computer ProgramRef Page (b) Pseudocode THEN IF Condition Process 1 ENDIF THEN Process 1 Yes No (a) Flowchart IF (condition) Selection Logic (IF…THEN Structure)Selection Logic (IF…THEN Structure) 200
  • 37. Computer Fundamentals: Pradeep K. Sinha & Priti SinhaComputer Fundamentals: Pradeep K. Sinha & Priti Sinha Slide 37/44Chapter 11: Planning the Computer ProgramRef Page Selection Logic (CASE Structure)Selection Logic (CASE Structure) (b) Pseudocode Case Type 1: Process 1 CASE Type ENDCASE Case Type 2: Process 2 Case Type n: Process n Type 1 Type 2 Type n Process 2 Process 1 Process n Yes Yes Yes No No No (a) Flowchart 201
  • 38. Computer Fundamentals: Pradeep K. Sinha & Priti SinhaComputer Fundamentals: Pradeep K. Sinha & Priti Sinha Slide 38/44Chapter 11: Planning the Computer ProgramRef Page Iteration (or Looping) LogicIteration (or Looping) Logic § Used to produce loops in program logic when one or more instructions may be executed several times depending on some conditions § Two popularly used iteration logic structures are 1. DO…WHILE 2. REPEAT…UNTIL 201
  • 39. Computer Fundamentals: Pradeep K. Sinha & Priti SinhaComputer Fundamentals: Pradeep K. Sinha & Priti Sinha Slide 39/44Chapter 11: Planning the Computer ProgramRef Page Iteration (or Looping) Logic (DO…WHILE Structure) Iteration (or Looping) Logic (DO…WHILE Structure) (b) Pseudocode DO WHILE Condition Process 1 ENDDO Process n Process 1 False (a) Flowchart Process n True Condition? Block 202
  • 40. Computer Fundamentals: Pradeep K. Sinha & Priti SinhaComputer Fundamentals: Pradeep K. Sinha & Priti Sinha Slide 40/44Chapter 11: Planning the Computer ProgramRef Page Iteration (or Looping) Logic (REPEAT…UNTIL Structure) Iteration (or Looping) Logic (REPEAT…UNTIL Structure) (b) Pseudocode REPEAT Process 1 UNTIL Condition Process n Process 1 (a) Flowchart Process n True False Condition? 202
  • 41. Computer Fundamentals: Pradeep K. Sinha & Priti SinhaComputer Fundamentals: Pradeep K. Sinha & Priti Sinha Slide 41/44Chapter 11: Planning the Computer ProgramRef Page Sample Pseudocode (for Example 6)Sample Pseudocode (for Example 6) Set Count to zero Read first student record DO WHILE Sexcode is not equal to Z IF Sexcode = F THEN Calculate Percentage IF Percentage = > 45 THEN IF Percentage < 60 THEN Write output data Add 1 to Count ENDIF ENDIF ENDIF Read next student record ENDDO Write Count Stop 203
  • 42. Computer Fundamentals: Pradeep K. Sinha & Priti SinhaComputer Fundamentals: Pradeep K. Sinha & Priti Sinha Slide 42/44Chapter 11: Planning the Computer ProgramRef Page Advantages of PseudocodeAdvantages of Pseudocode § Converting a pseudocode to a programming language is much more easier than converting a flowchart to a programming language § As compared to a flowchart, it is easier to modify the pseudocode of a program logic when program modifications are necessary § Writing of pseudocode involves much less time and effort than drawing an equivalent flowchart as it has only a few rules to follow 204
  • 43. Computer Fundamentals: Pradeep K. Sinha & Priti SinhaComputer Fundamentals: Pradeep K. Sinha & Priti Sinha Slide 43/44Chapter 11: Planning the Computer ProgramRef Page Limitations of PseudocodeLimitations of Pseudocode § In case of pseudocode, a graphic representation of program logic is not available § There are no standard rules to follow in using pseudocode § Different programmers use their own style of writing pseudocode and hence communication problem occurs due to lack of standardization § For a beginner, it is more difficult to follow the logic of or write pseudocode, as compared to flowcharting 204
  • 44. Computer Fundamentals: Pradeep K. Sinha & Priti SinhaComputer Fundamentals: Pradeep K. Sinha & Priti Sinha Slide 44/44Chapter 11: Planning the Computer ProgramRef Page Key Words/PhrasesKey Words/Phrases § Algorithm § Basic logic structures § Control structures § Flowchart § Iteration logic § Looping logic § Micro flowchart § Macro flowchart § Pseudocode § Program Design Language (PDL) § Sequence logic § Selection logic § Sentinel value § Structured programming § Trailer record 204