















Study with the several resources on Docsity
Earn points by helping other students or get them with a premium plan
This page cannot be seen from the preview
Don't miss anything!
















Powerpoint slides to be used with “C Programming for Beginners” by HC Ling, SN Cheong, YK Teh,LC Kwek, Emerson, Vishnu Monn B and Badrolhisham (Pearson Education, 2010)
-^
-^
-^
Objectiveslearn to design and represent algorithms usingpseudocode and flowcharts
Powerpoint slides to be used with “C Programming for Beginners” by HC Ling, SN Cheong, YK Teh,LC Kwek, Emerson, Vishnu Monn B and Badrolhisham (Pearson Education, 2010)
Learning Outcomes
-^
-^
-^
The Waterfall Model
-^
-^
Powerpoint slides to be used with “C Programming for Beginners” by HC Ling, SN Cheong, YK Teh,LC Kwek, Emerson, Vishnu Monn B and Badrolhisham (Pearson Education, 2010)
The Waterfall Model
-^
expected functionalities and constraints) are clearly defined
implementing them in the system are also investigated
-^
Powerpoint slides to be used with “C Programming for Beginners” by HC Ling, SN Cheong, YK Teh,LC Kwek, Emerson, Vishnu Monn B and Badrolhisham (Pearson Education, 2010)
-^
outputs and any special conditions or constraints imposed
established
relate the input and output data
The Waterfall Model
-^
representation
used, identifying modules and interfaces between modules
-^
Design tools:
pseudocode,
flowchart
Powerpoint slides to be used with “C Programming for Beginners” by HC Ling, SN Cheong, YK Teh,LC Kwek, Emerson, Vishnu Monn B and Badrolhisham (Pearson Education, 2010)
Design tools:
pseudocode,
flowchart
each one of them separately, and then combines them
i.e.,
The Waterfall Model
-^
language
code should be smooth
-^
Each line of
pseudocode
or each block of a flowchart should be
Powerpoint slides to be used with “C Programming for Beginners” by HC Ling, SN Cheong, YK Teh,LC Kwek, Emerson, Vishnu Monn B and Badrolhisham (Pearson Education, 2010)
Each line of
pseudocode
or each block of a flowchart should be
translated into one or few lines of real code
-^
corrections to eliminate these errors
Algorithms
-^
these instructions should be performed
-^
Powerpoint slides to be used with “C Programming for Beginners” by HC Ling, SN Cheong, YK Teh,LC Kwek, Emerson, Vishnu Monn B and Badrolhisham (Pearson Education, 2010)
Temperature in Celsius
Temperature in Fahrenheit
Algorithms
-^
they are written
-^
Powerpoint slides to be used with “C Programming for Beginners” by HC Ling, SN Cheong, YK Teh,LC Kwek, Emerson, Vishnu Monn B and Badrolhisham (Pearson Education, 2010)
Pseudocode
-^
-^
-^
-^
Powerpoint slides to be used with “C Programming for Beginners” by HC Ling, SN Cheong, YK Teh,LC Kwek, Emerson, Vishnu Monn B and Badrolhisham (Pearson Education, 2010)
-^
and data manipulations, function calls, etc
Flowcharts
-^
-^
arrows
Powerpoint slides to be used with “C Programming for Beginners” by HC Ling, SN Cheong, YK Teh,LC Kwek, Emerson, Vishnu Monn B and Badrolhisham (Pearson Education, 2010)
Examples of Algorithm Designs
-^
Powerpoint slides to be used with “C Programming for Beginners” by HC Ling, SN Cheong, YK Teh,LC Kwek, Emerson, Vishnu Monn B and Badrolhisham (Pearson Education, 2010)
Prompt user for two numbersInput a and b from userIf a is smaller than b
Print a and b Otherwise
Print b and a
Examples of Algorithm Designs
-^
Powerpoint slides to be used with “C Programming for Beginners” by HC Ling, SN Cheong, YK Teh,LC Kwek, Emerson, Vishnu Monn B and Badrolhisham (Pearson Education, 2010)
While count is less than or equal to 3
Print count
Applying Software Development Method
(2/5)
-^
order
Initialize variables
Input data from user, determine and sum all odd
integers
Powerpoint slides to be used with “C Programming for Beginners” by HC Ling, SN Cheong, YK Teh,LC Kwek, Emerson, Vishnu Monn B and Badrolhisham (Pearson Education, 2010)
integers
Display the result
Initialize variables
to
-^
Input data from user,
determine and sum all odd integers
to
While integer is not
1
Applying Software Development Method
(3/5)
Powerpoint slides to be used with “C Programming for Beginners” by HC Ling, SN Cheong, YK Teh,LC Kwek, Emerson, Vishnu Monn B and Badrolhisham (Pearson Education, 2010)
-^
While integer is not
1
» If the remainder of dividing integer by 2 is 1
sum = sum + integer
» Input integer
Display the result
to